Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql ListBox的WHERE子句中出现VBA更新错误_Sql_Vba_Ms Access 2016 - Fatal编程技术网

Sql ListBox的WHERE子句中出现VBA更新错误

Sql ListBox的WHERE子句中出现VBA更新错误,sql,vba,ms-access-2016,Sql,Vba,Ms Access 2016,我试图更新一个表,其中ListBox.ItemData(intCount)等于表中的一个字段,但我似乎无法理解where子句 Private Sub btnAdd_Click() Dim intCount As Integer For intCount = 0 To DCount("PONum", "tblBOMReceiptDetails") If Me.lstBox.Selected(intCount) <> 0

我试图更新一个表,其中ListBox.ItemData(intCount)等于表中的一个字段,但我似乎无法理解where子句

Private Sub btnAdd_Click()

    Dim intCount As Integer
    For intCount = 0 To DCount("PONum", "tblBOMReceiptDetails")
    If Me.lstBox.Selected(intCount) <> 0 Then

    DoCmd.RunSQL "UPDATE tblBOMReceiptDetails SET tblBOMReceiptDetails.ContainerNumber = [Forms]![frmUnapprovedPOs_New]![txtContainerNumber], tblBOMReceiptDetails.BOL = [Forms]![frmUnapprovedPOs_New]![txtBOL], tblBOMReceiptDetails.ReceivedLocation = [Forms]![frmUnapprovedPOs_New]![txtReceivedLocation], tblBOMReceiptDetails.SteamShip = [Forms]![frmUnapprovedPOs_New]![txtSteamShip], tblBOMReceiptDetails.Trucker = [Forms]![frmUnapprovedPOs_New]![txtTrucker], tblBOMReceiptDetails.Comments = [Forms]![frmUnapprovedPOs_New]![txtComments] WHERE tblBOMReceiptDetails.LOTNum = " & Me.lstBox.ItemData(intCount) & ""

        End If
        Next
        Me.lstBox.Requery
Private Sub btnAdd_Click()
Dim intCount为整数
对于intCount=0到DCount(“PONum”、“tblBOMReceiptDetails”)
如果选择了Me.lstBox.0(intCount),则
DoCmd.RunSQL“更新tblBOMReceiptDetails集tblBOMReceiptDetails.ContainerNumber=[Forms]![frmUnapprovedPOs\u New]![txtContainerNumber],tblBOMReceiptDetails.BOL=[Forms]![frmUnapprovedPOs\u New]![frmUnapprovedPOs\u New]![txtReceivedLocation],tblBOMReceiptDetails.SteamShip=[Forms]![frmUnapprovedPOs_New]![txtSteamShip],tblBOMReceiptDetails.Trucker=[Forms]![frmUnapprovedPOs_New]![txtTrucker],tblBOMReceiptDetails.Comments=[Forms]![frmUnapprovedPOs_New]![txtComments]其中tblBOMReceiptDetails.LOTNum=“&Me.lstBox.ItemData(intCount)&”
如果结束
下一个
Me.lstBox.Requery
更新错误是什么?请尝试删除最后一个符号和引号:
和“
”。