Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture results of docmd.openquery 1

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
US
This seems like a dumb question, but...

If I use docmd.openquery(queryname) and the query returns 0 records, can I capture that result and display a message box?

Thanks.
 
HI....

It is possible to obtain the count of records returned by Query using DCOUNT.

Place the following in the Click Event of a command button.
Fill values as needed.


Dim MyCount as Double

MyCount = DCOUNT("[SomeField]","YourQuery")

MsgBox "There are " & MyCount & " record(s) available!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top