0

我的代码给出了以下错误。我该如何纠正?

在与请求的名称或序号对应的集合中找不到项目

ElseIf Me.chkItem.Checked = True Then
    Dim CheckNumber As String = ""
    Dim CheckRef As String = ""
    dsvoucheritem.Clear()
    DSVoucher_Expense.Clear()
    DSVoucher_Check.Clear()

    Try
        Me.lstCV.Items.Clear()
        strDiscount = Nothing
        rec.Open("select billpaymentcheckline.txnnumber, billpaymentcheckline.txndate" _
        & ", billpaymentcheckline.payeeentityreffullname" _
        & ", billpaymentcheckline.amount, billitemline.itemlineitemreffullname" _
        & ", billitemline.memo" _
        & ", billpaymentcheckline.appliedtotxndiscountamount" _
        & ", billpaymentcheckline.appliedtotxnrefnumber, billpaymentcheckline.bankaccountreffullname" _
        & ", billpaymentcheckline.appliedtotxndiscountaccountreffullname" _
        & ", billpaymentcheckline.appliedtotxntxndate, billpaymentcheckline.appliedtotxnamount" _
        & ", billpaymentcheckline.refnumber, account.AccountNumber from (billitemline inner join" _
        & " billpaymentcheckline on billitemline.refnumber=billpaymentcheckline.appliedtotxnrefnumber) left outer join" _
        & " account on billitemline.APAccountreflistid=account.listid where" _
        & " billpaymentcheckline.bankaccountreflistid='" &Me.lblBankID.Text & "' and" _
        & " billpaymentcheckline.refnumber between '" & CInt(Me.txtRefFR.Text)
        & "' and '" & CInt(Me.txtRefTO.Text) & "'", con, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly)
4

2 回答 2

0

memo是 Access SQL 中的保留字

尝试billitemline.[memo]

于 2016-08-10T07:08:45.230 回答
0

它是说它无法识别您的列名之一。仔细检查所有这些。您也可以尝试删除字段,直到找到罪魁祸首。

于 2016-08-10T04:56:34.750 回答