PDA

View Full Version : Solved: No data found in Report



RobertBC
09-02-2006, 06:38 AM
good Day!

about error handling,

what if the report found no data to print or (#err found on my textbox's)! how do i create error report that the report found no data and dont open Preview report or print the report.

tahnk you! :friends:

matthewspatrick
09-02-2006, 01:22 PM
If the report has no data at all, then the report's NoData event will fire. Use that event sub to do what you want to do in that case.

I suppose you could use the Format event for the detail section of your report to check your textboxes to see if error conditions obtain...

geekgirlau
09-04-2006, 04:01 AM
As Patrick states, the No Data event will handle it adequately in most circumstances. You can put your own message in at this point, and then (from memory) set Cancel = True which will close the preview. You will, however, have to deal with the error that this generates for the OpenReport statement.

RobertBC
09-04-2006, 05:53 AM
Thank you very much for your help! :friends:

you are a big help! i've done it right thanks again