Do not show an empty table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm going to use an unmatched query in a macro and if the two tables match, I
don't want an empty table to open. How would I "program" the unmatched query
so that it only opens if there are records?
 
Use code for that, create a function in a module

Function NewFunctionName()

If Dcount("*","QueryName") > 0 Then
docmd.OpenQuery "QueryName"
End If

End Function
=====================
If you still want to use a macro, create one that calls the above function.
 
Thanks, I got that to work

Ofer Cohen said:
Use code for that, create a function in a module

Function NewFunctionName()

If Dcount("*","QueryName") > 0 Then
docmd.OpenQuery "QueryName"
End If

End Function
=====================
If you still want to use a macro, create one that calls the above function.
 

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