UPDATE SQL statement problem

CBG2112

Registered User.
Local time
Today, 00:01
Joined
Aug 4, 2009
Messages
32
I need syntax help for an UPDATE statement. I'm trying to update StatusTx with the value listed on the CBOSTStatus and the StatusDt with the date/time the value was updated. It's producing a Run-time error '3144': Syntax error in UPDATE statement. I have listed the code below. I appreciate any help I can get. Thanks.

Code:
Dim strSQL As String
cboSTStatus.SetFocus
strSQL = "UPDATE tblTask" & _
             "SET [StatusTx]='" & Me.cboSTStatus.Value & "', " & _
             "[StatusDt]=#" & Me.StatusDt.Value & "# " & _
             "WHERE [TaskID]=" & Me.TaskID.Value

DoCmd.RunSQL strSQL
 
There should be a space after the table name... not sure if that's the only issue but it's the first one I see. If that doesn't work...try using

Msgbox strSQL, vbinformation

to look at the sql statement just before you execute it. It may show you the problem.
 

Users who are viewing this thread

Back
Top Bottom