Thingol
Technical User
- Jan 2, 2002
- 169
Hi All,
I'm trying to create an Update query through VBA. This is the code I currently use to set the sql of the query:
I want to open the update query from code, so that the query qrySelection gets updated automatically. How can I do this?
Thanks a lot for any help!
Best regards,
Martijn Senden.
In the Beginning there was nothing, which exploded.
--Terry Pratchett, Lords and Ladies--
I'm trying to create an Update query through VBA. This is the code I currently use to set the sql of the query:
Code:
Set db = CurrentDb()
strSQL = ""
Set Q = db.CreateQueryDef("qrySelectionLabelsUpdate")
strSQL = "UPDATE qrySelection SET qrySelection.Gender = 'Sir' WHERE (((qrySelection.Gender)='Male' Or (qrySelection.Gender)='2'));"
Q.sql = strSQL
Q.Close
I want to open the update query from code, so that the query qrySelection gets updated automatically. How can I do this?
Thanks a lot for any help!
Best regards,
Martijn Senden.
In the Beginning there was nothing, which exploded.
--Terry Pratchett, Lords and Ladies--