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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you know if a report will be empty?

Status
Not open for further replies.

dameeti

Programmer
Dec 20, 2004
24
US
I need to know how to get the record count from a query. I know this is probably simple, but I'm at a loss right now.

I have a query that is the source for a report, but I want to know (before the report runs) if there are no records so I can not even bring up the report on the screen (in preview mode).

I have a button on my main data entry form that invokes the report (preview mode) so the user can see the results. But if there are no records, it doesn't really make sense to present the report. I'm assuming that I have to run the query (and then check the record count?) from the VB subroutine BEFORE I invoke the report but I'm at a loss how.

I don't know how to run the query independent of the report to get the count from Visual Basic.

Any help would be appreciate. Any and all details (I'm guessing the 4-5 lines of Visual Basic code needed would be great).
 
Thanks. This sounds like exactly what I needed. Thanks!! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top