Reputation: 103
Could someone please tell me where I am going with the syntax in this update command?
CurrentDb.Execute "UPDATE VolunteerDetails" & "SET FirstName=" & Me.frst_Name_txt & ", LastName='" & Me.lst_Name_txt & "'" & " WHERE VolsID=" & Me.vol_ID_txt
Thanks!
I have tried it a new way, to make it simpler....but is still giving me a syntax error.
CurrentDb.Execute "UPDATE VolunteerDetails SET FirstName=Me.frst_Name_txt, LastName=Me.lst_Name_txt, WHERE VolsID=Me.vol_ID_txt"
Upvotes: 2
Views: 72
Reputation: 1500055
Your SQL will look something like:
UPDATE VolunteerDetailsSET FirstName=Foo, LastName='Bar' WHERE VolsID=10
Three problems with this:
VolunteerDetails
and SET
It's not clear what language you're using (VB? just straight Access forms?) but you should definitely use parameterized SQL. If you can give us more data about your environment, we can help you more.
Upvotes: 5