Eljefegeneo
Still trying to learn
- Local time
- Today, 09:59
- Joined
- Jan 10, 2011
- Messages
- 902
I have the following code to print two reports :
And for the NoData Event of the report I have
Error message 2501 pops up saying that the open report event was cancelled. If I add line
All is OK, but that really does not tell me why I was getting the error message.
Code:
Dim rpt, rpt1, cond As String
rpt = "rptEmailReportCurrentMonth"
rpt1 = "rptEmailReportCurrentMonthReceived"
cond = "[agentID] = Forms!frmAgentEmailsByAgent.AgentID"
DoCmd.OpenReport rpt, acViewNormal, , cond
DoCmd.OpenReport rpt1, acViewNormal, , cond
Code:
Cancel = True
Code:
On error resume next