Kamis, 29 November 2012

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

 

V just comes from me. I just want to have all of the Status field values change to V for the ticket that the user selects. The Status field is text.

Thanks,
Tony

-----Original Message-----
From: Duane Hookom <duanehookom@hotmail.com>
To: Access Professionals Yahoo Group <ms_access_professionals@yahoogroups.com>
Sent: Fri, Nov 30, 2012 12:15 am
Subject: RE: [MS_AccessPros] Using UPDATE to change data in a table via combobox and command button

Where does V come from? Is the Status field text or numeric?

Learn how to implement
Debug.Print strSQL
So you can troubleshoot on your own.

Duane Hookom MVP
MS Access

> From: GKillah36@aol.com
>
> 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.



[Non-text portions of this message have been removed]

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

__,_._,___

Tidak ada komentar:

Posting Komentar