Kamis, 29 November 2012

[MS_AccessPros] Using UPDATE to change data in a table via combobox and command button

 

Hi all,

Please see my VB below:

Private Sub commandVoid_Click()

Dim strSQL As String

If MsgBox("Are you sure you want to void this ticket?", vbYesNo) = vbYes Then
strSQL = "UPDATE tableWarehouseData " & _
"SET Status = " & V & " " & _
"WHERE ticket = " & Me.comboVoidTicket & ""
CurrentDb.Execute strSQL, dbFailOnError
End If
End Sub

----------------------------------------

This should change the Status field of all tickets in the table tableWarehouseData to V when clicked based on the selected ticket number in the comboVoidTicket combobox. However, I'm getting an error of "Run-time error '3144': Syntax error in UPDATE statement." What am I missing here?

Thank you,
Tony

FYI, I'm using Access 2010.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar