I'm trying to make a query like so:
UPDATE table1 SET col1 = 'foo', col2 = 'bar';
UPDATE table2 SET hi = 'bye', bye = 'hi';
But when I go to save, Access errors with:
Characters found after end of SQL statement
After some searching, it would appear this is because Access can only do one query at a time.
How can I do this?
Where are you working? You can run multiple queries in VBA or via macros. Some examples:
CurrentDB.Execute "UPDATE table1 SET col1 = 'foo', col2 = 'bar';", dbFailOnError
CurrentDB.Execute "UPDATE table2 SET hi = 'bye', bye = 'hi';", dbFailOnError
Saved query:
CurrentDb.Execute "Query5", dbFailOnError
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With