Private Sub cmdShow_Click()
'lblTotPur/lblTotPayRet/lblBalance
Dim strShow, mSlNo
Dim rsShow As New ADODB.Recordset
Dim NewItem As Variant
If Trim(txtCustomer.Text) = "" Then
MsgBox "Please select vendor to proceed...", vbCritical, POPUP_COMP
Exit Sub
End If
Dim recCnt
pgrPartyLedger.Min = 0
recCnt = 0
'VOUCHMST_P//VNO,DATED,VTYPE,REMARKS,byUser CASH PURCHASE RETURN
strShow = "select Count(*) as mCnt from VOUCHMST A,VOUCHDAT B, mPurchase C "
strShow = strShow & " where A.VNO=B.VNO and (A.REMARKS='CASH PURCHASE RETURN' OR A.REMARKS='CREDIT PURCHASE RETURN' OR A.REMARKS='CREDIT PURCHASE' OR A.REMARKS='CASH PURCHASE' OR A.REMARKS='PAYMENT' OR A.REMARKS='CREDIT NOTE') "
strShow = strShow & " and A.DATED between #" & Format(dtFrom.Value, "MM/dd/yyyy") & "# "
strShow = strShow & " and #" & Format(dtTo.Value, "MM/dd/yyyy") & "# "
strShow = strShow & " and B.IDNO = '" & Trim(txtCustomerId.Text) & "' "
strShow = strShow & " and A.VREFNO = C.PurBillNo "
'strShow = strShow & " order by A.ID,A.DATED,A.VNO"
rsShow.Open strShow, cn
recCnt = rsShow("mCnt")
rsShow.Close
pgrPartyLedger.Max = recCnt + 1
'VOUCHMST_P//VNO,DATED,VTYPE,REMARKS,byUser
strShow = "select A.Id,A.cmnt,A.VNO,A.DATED,B.IDNO,B.IDNAME,B.AMOUNT,B.DR_CR,B.VNARRATION,A.REMARKS,C.DealInvNo, B.CQ_TYPE, B.BANKNAME, B.BANKBRANCH, B.CQ_NO from VOUCHMST A,VOUCHDAT B,mPurchase C "
strShow = strShow & " where A.VNO=B.VNO and (A.REMARKS='CASH PURCHASE RETURN' OR A.REMARKS='CREDIT PURCHASE RETURN' OR A.REMARKS='CREDIT PURCHASE' OR A.REMARKS='CASH PURCHASE' OR A.REMARKS='PAYMENT' OR A.REMARKS='CREDIT NOTE') "
strShow = strShow & " and A.DATED between #" & Format(dtFrom.Value, "MM/dd/yyyy") & "# "
strShow = strShow & " and #" & Format(dtTo.Value, "MM/dd/yyyy") & "# "
strShow = strShow & " and B.IDNO = '" & Trim(txtCustomerId.Text) & "' "
strShow = strShow & " and A.VREFNO = C.PurBillNo "
strShow = strShow & " order by A.ID,A.DATED,A.VNO"
rsShow.Open strShow, cn
Dim mPur, mPayRet, mAnyAdv, mTempVNO
mPur = 0
mPayRet = 0
mAnyAdv = 0
mSlNo = 1
ShowPaymentHeader
Do While Not rsShow.EOF
mTempVNO = rsShow("VNO")
Set NewItem = listViewPayment.ListItems.Add(, "C" & mSlNo, Format(rsShow("DATED"), "dd/MM/yyyy"))
NewItem.SubItems(1) = rsShow("VNO")
NewItem.SubItems(13) = rsShow("DealInvNo")
NewItem.SubItems(2) = IIf(IsNull(rsShow("IDNAME")), "", CommaFilterText(rsShow("IDNAME"), 1))
If Trim(rsShow("REMARKS")) = "CASH PURCHASE" Then
NewItem.SubItems(3) = FormatTakaPaisa(rsShow("AMOUNT"))
NewItem.SubItems(4) = FormatTakaPaisa(rsShow("AMOUNT"))
ElseIf Trim(rsShow("REMARKS")) = "CREDIT PURCHASE" Then
mAnyAdv = ShowPartialAdvance(rsShow("VNO"))
NewItem.SubItems(3) = FormatTakaPaisa(rsShow("AMOUNT") + Val(mAnyAdv))
If Val(mAnyAdv) > 0 Then
NewItem.SubItems(4) = FormatTakaPaisa(mAnyAdv)
Else
NewItem.SubItems(4) = ""
End If
Else
NewItem.SubItems(3) = ""
NewItem.SubItems(4) = FormatTakaPaisa(rsShow("AMOUNT"))
NewItem.SubItems(7) = rsShow("CQ_TYPE")
NewItem.SubItems(8) = rsShow("BANKNAME")
NewItem.SubItems(9) = rsShow("BANKBRANCH")
**
> NewItem.SubItems(9) = rsShow("cmnt")
**
End If
NewItem.SubItems(6) = rsShow("IDNO")
mPur = mPur + Val(NewItem.SubItems(3))
mPayRet = mPayRet + Val(NewItem.SubItems(4))
NewItem.SubItems(5) = rsShow("REMARKS")
NewItem.SubItems(12) = GetVoucherRefNo(mTempVNO)
pgrPartyLedger.Value = mSlNo
mSlNo = mSlNo + 1
rsShow.MoveNext
Loop
rsShow.Close
lblTotPur.Caption = FormatTakaPaisa(mPur)
lblTotPayRet.Caption = FormatTakaPaisa(mPayRet)
lblBalance.Caption = FormatTakaPaisa(mPur - mPayRet)
pgrPartyLedger.Value = 0
End Sub
我收到類型不匹配運行時錯誤13該行,請幫我Type在VB6不匹配錯誤13,ADODB記錄循環中
是什麼'rsShow( 「CMNT」)'包含哪些內容? – GSerg
它包含來自數據庫的一些數據,我試圖獲取,「cmnt」列在VOUCHMST表中。 –
「某些數據」不是有效的描述。這個數據是什麼類型,它可以存儲在'NewItem.SubItems(9)'中? – GSerg