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

Error Prompt for a Report with no Data

Status
Not open for further replies.

rooterr

Technical User
May 15, 2001
21
0
0
US
I am curious is there an easy way to create an Error Prompt to the user when a Report based off a parameter query returns no data. My current database has a lot of dates and if you enter in certain parameters it is very easy to generate a report that is blank. I want it to prompt them saying "The date range you entered is too restricting. No records were found". Is this possible without a lot of code.

Thanks,
RT
 
Use the OnNoData event of the report!

Private Sub Report_NoData(Cancel As Integer)
MsgBox "The date range you entered is too restricting. No records were found."
Cancel = True
End Sub

HTH
Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.police.uk
----------------------------------
 
Thanks Ben worked like a charm.

RT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top