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).
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).