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

no data Event problem 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
Hi all

With report I have created a no data Event. The problem arises when this event runs cause DoCmd.OpenReport "rptPickingList" is cancelled and a runtime error occurs.

Is it possible to solve such problem?

Thanks in advance
Kenneth Agius.


 
The error is supposed to happen, it sounds like you have 2 minor problems.
1. you do not have an error handler where you make your report call from.
2. you do not have a sub to handle the no data event

1a. insert something like this
ExitError:
Exit Sub
ErrHandle:
If Err <> 2501 Then MsgBox Err.Description, , "YrApp"
Resume ExitError

2a. on your report insert this

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data was found - the report will close" , , "YrApp"
Cancel = True
End Sub


Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top