Problem with SQL statement in VBA

Doozer1979

Registered User.
Local time
Today, 09:48
Joined
Jul 4, 2007
Messages
32
Hello all,

I'm having a bit of trouble with the follwing VBA code

DoCmd.RunSQL "UPDATE AlertsAM SET StationGroupID = " & Me.txtGroupID.Value & " WHERE(AlertsAM.AlertAMID) = " & Me.txtAlertAMID & ";"
DoCmd.RunSQL "UPDATE AlertsAM SET StationID = " & Me.txtStationID.Value & " WHERE(AlertsAM.AlertAMID) = " & Me.txtAlertAMID & ";"



I get a runtime error of 3075 missing operator in query expression (AlertsAM.AlertAMID) =


Any ideas anyone?

thank you
 
Start by getting rid of the parentheses and putting a space after WHERE. If it still errors, hover over the form references and see if there's a value there. I assume both ID fields are numeric?
 
Getting rid of the parentheses seemed to do the trick. Thank you very much!
 
Actually it was probably the space, but the parentheses aren't necessary. Glad you got it going.
 

Users who are viewing this thread

Back
Top Bottom