Query empty If, then

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date 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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top