Running a saved query

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to run a saved query and just need to know if there are any records
returned. Not interested in actual records. What is the easiest way to do
this?

Thanks

Regards
 
If DCount("*", "NameOfSavedQuery") > 0 Then
' there's data
Else
' there's no data
End If
 
I would use code like:
If DCount("*","[a saved query]")>0 Then
msgbox "There are records"
End If
 
You could use the DCount function to return the number of rows, e.g.

If DCount("*", "YourQueryName") > 0 Then
MsgBox "Query returns rows."
End if

Ken Sheridan
Stafford, England
 

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