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

#ERROR on no data reports 1

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
I am sure this question has been asked before but I could not find it in the 6 month archive.

When there are no records to be printed on a report. I have issued a msg based on the "report no data" event. But how do you get the report to either close or get rid of the #ERROR that displays. You are not allowed to move other values to the fields, I tried using a text boxes and issuing a IIF command, I also tried a docmd.close. I am out of idea. Does anyone have any good ideas?

Thanks a lot
Trudye
 
As you have mentioned you have already created an error message. So the only thing left is to make 'Cancel = True' this will close the report after the user closes the message box.

Here is an example:

Private Sub Report_NoData(Cancel As Integer)
MsgBox "Error Message Here!", vbOKOnly + vbInformation
Cancel = True
End Sub


Good Luck
 
There is just on word to decribe you and your advice

"COOL!!"


Thanks so much
Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top