J
jln via AccessMonster.com
Here's my problem When i run into a report that has no data it cancels the
print job of the report. and when it does this i get the 2501 error. When i
step thought the code it never goes to the error handler when the error pops
up. This was working for 4 months or so and just stoped with no changes being
made. to the code.
Here is my button code.
Private Sub Command3_Click()
Dim strWhere As String
strWhere = "1=1"
If Not IsNull(Me.txtInvNo) Then
strWhere = strWhere & "And [Investor_Number]=" & Me.txtInvNo
End If
On Error GoTo Err_Command3_Click
DoCmd.OpenReport "Rec", acprint, , strWhere
DoCmd.OpenReport "ESCADV/CORPADV", acprint, , strWhere
DoCmd.OpenReport "MI_Claims", acprint, , strWhere
DoCmd.OpenReport "MI Refunds II", acprint, , strWhere
DoCmd.OpenReport "NEG/ESC/COPRADV/1", acprint, , strWhere
DoCmd.OpenReport "rpt_PPP", acprint, , strWhere
DoCmd.OpenReport "MI_Refunds", acprint, , strWhere
DoCmd.OpenReport "RECNEG", acprint, , strWhere
DoCmd.OpenReport "MIReinstatements", acprint, , strWhere
DoCmd.OpenReport "negPPP", acprint, , strWhere
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
If Error.number = 2501 Then
Resume Next
Else
MsgBox Err.Description
Resume Exit_Command3_Click
End If
End Sub
Here is my report code
MsgBox "There is no data for this report"
Cancel = True
print job of the report. and when it does this i get the 2501 error. When i
step thought the code it never goes to the error handler when the error pops
up. This was working for 4 months or so and just stoped with no changes being
made. to the code.
Here is my button code.
Private Sub Command3_Click()
Dim strWhere As String
strWhere = "1=1"
If Not IsNull(Me.txtInvNo) Then
strWhere = strWhere & "And [Investor_Number]=" & Me.txtInvNo
End If
On Error GoTo Err_Command3_Click
DoCmd.OpenReport "Rec", acprint, , strWhere
DoCmd.OpenReport "ESCADV/CORPADV", acprint, , strWhere
DoCmd.OpenReport "MI_Claims", acprint, , strWhere
DoCmd.OpenReport "MI Refunds II", acprint, , strWhere
DoCmd.OpenReport "NEG/ESC/COPRADV/1", acprint, , strWhere
DoCmd.OpenReport "rpt_PPP", acprint, , strWhere
DoCmd.OpenReport "MI_Refunds", acprint, , strWhere
DoCmd.OpenReport "RECNEG", acprint, , strWhere
DoCmd.OpenReport "MIReinstatements", acprint, , strWhere
DoCmd.OpenReport "negPPP", acprint, , strWhere
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
If Error.number = 2501 Then
Resume Next
Else
MsgBox Err.Description
Resume Exit_Command3_Click
End If
End Sub
Here is my report code
MsgBox "There is no data for this report"
Cancel = True