Referencing result of running a Select query in Access VBA code - TechRepublic
Question
September 3, 2007 at 03:01 PM
mitchlyn_gentry

Referencing result of running a Select query in Access VBA code

by mitchlyn_gentry . Updated 18 years, 9 months ago

I’m teaching myself Access VBA and I’m stumped. I want to execute code depending on if a record has already been entered in a table. Basically, if the record already exists, I want to update it. If it doesn’t exist, I want to add it.

To accomplish this, I chose to execute a Select query where the record key equals what I’m looking for. If the query returns a NULL recordset, I know what to do.

How do I capture the ERR.Description that comes back when I get the NULL recordset on a “DoCmd.RunSQL XXXXX” command?

This discussion is locked

All Comments