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.
 
Back
Top