I am using a barcode scanner to grab value for scanno and it displays the value properly in msgbox but won't update
the table. Syntax problem? Will work if I hardcode the barcode number in instead of using variable.
Public Function createbatch()
Dim SQL As String
Dim scanno As String
scanno = InputBox("Scan Item or 'q' to quit")
If scanno = "q" Then
MsgBox ("Good Bye")
Else: MsgBox ("The scan indicated " & scanno)
SQL = "Update propertyitem Set BatchAction = True where barcodenumber = '" & scanno &"'"
DoCmd.RunSQL SQL
End If
End Function
the table. Syntax problem? Will work if I hardcode the barcode number in instead of using variable.
Public Function createbatch()
Dim SQL As String
Dim scanno As String
scanno = InputBox("Scan Item or 'q' to quit")
If scanno = "q" Then
MsgBox ("Good Bye")
Else: MsgBox ("The scan indicated " & scanno)
SQL = "Update propertyitem Set BatchAction = True where barcodenumber = '" & scanno &"'"
DoCmd.RunSQL SQL
End If
End Function