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

Test if query returns any results

Status
Not open for further replies.

itchyII

MIS
Apr 10, 2001
167
0
0
Hello All,
I have a query that has criteria which is passed to it from a report. The results of the query are then used in a sub-report which will be shown on the same page of the report where the criteria was taken from. Calculations then take place based on the contents of this sub-report. The problem I have is if the query returns no records, the sub-report is blank and all my calculations show errors. I want to be able to test for results from the query, if there were no records found, I will fill in the appropriate fields with zero's so as to not mess up my calcuations. If possible, I would like to test for this from my sub-form in the 'On Format' event, so I can make any necessary changes there right away before it is passed to the main report.

Access '97

Thanks!
 
Have you tried using the HasData property. Search Access help on this property. I think it will do what you want.

KF,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top