By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,827 IT Pros & Developers. It's quick & easy.

Display new report when chosen one contains no data...

P: 94
I have a complicated report with numerous parameters which will on occasion return no records.

What i want to do is have a new report display when this happens which includes the company logo etc. stating something like "The parameters you have entered have returned no data, please try again."

I don't want to achieve this using a message box or any pop ups at all, due to the way my users are accessing the reports it will have to be a report which gives them the message.

I currently have in the no data property...
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "BWRptNO_DATA", acViewPreview
which will open the new report but it does so behind the report with no data in.
Every time i try to insert a Close somewhere in the code....
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "BWRptNO_DATA", acViewPreview
  2. DoCmd.Close acReport, "BWrptAnalysisOfEnrolmentsByPostCode"
i get an error message saying "This action can't be carried out while processing a form or report event.

Can anyone help me?
Mar 10 '08 #1
Share this Question
Share on Google+
1 Reply

P: 94
Fixed it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.     DoCmd.OpenReport "BWRptNO_DATA", acViewPrevie
  3.     DoCmd.CancelEvent
  4. End Sub
Mar 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.