Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query from VB Code using barcode scanner

Status
Not open for further replies.

cplemons

IS-IT--Management
Aug 11, 2005
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top