Query empty If, then

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have code that I want to do an If statement that looks at a query and IF
the query is empty I want it to end the if. Or I could do it the other way If
the query has data then execute the next step Else End If.

Ho would I write the IF statement?
 
J

Jeff Boyce

Matt

One approach is to, in code, create a recordset based on the query. If you
count the records in the recordset, you find out if the query is "empty".

Or you might try using something like:
Nz(DCount(...),0)

Check the syntax on the DCount() function in Access HELP.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Top