Category: VBA
-
Troubleshooting Potential Errors when Using Transactions in Ms Access – Do NOT Close the Workspace!
I was doing some recordset juggling in vba and out of habit I usually close every object I open up explicit using the .close method on that object. For example if I open up a database using something like this Dim db as dao.database Set db = currentDb I will close it at the end…
-
Running SQL from Visual Basic Code – Apostrophe problems!
I recently encountered a problem that I’ve actually encountered millions of times before – trying to run an SQL string from VBA code which makes use of double apostrophe’s (“”). Naturally, VBA uses these to break from a string literal, but pure Jet-SQL uses them for functions like Format() and Nz(). So if you do…