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

catch error, fetch image 1

Status
Not open for further replies.

ailyn

Programmer
Sep 15, 2005
108
BE
I have a repport with a catching error message box. normally when there are records to repport it shows the image per record, but when I filter it by the results on a form query and there are no records to repport the image module gives error. My code is as follows:

Option Compare Database

Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records to report.", _
vbOKOnly + vbInformation, "No Data"
End Sub

Private Sub Details_Format(Cancel As Integer, FormatCount As Integer)
Me![PictureImage].Properties("Picture") = Me![txtImageName]
End Sub

I guess all I need is to catch the error and stop the Details_Format when there are no records to show, but how?
 
You may add the following line of code in the NoData event procedure:
Cancel = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top