PDA

View Full Version : Report_NoData



marsha4jesus
09-10-2007, 06:48 PM
The following code works fine if the printmode is acpreview, but with print mode of acnormal, it still goes to the printer. Please help! I do not want
it to go to the printer on acnormal. It says it is going to the printer, however it does not go to the printer


Private Sub Report_NoData(Cancel As Integer)
On Error GoTo HandleErrors
MsgBox "No data to Display"
Cancel = True
ExitHere:
Exit Sub
HandleErrors:
Select Case Err.Number
Case 2501
Resume ExitHere
Case Else
MsgBox Err.Description & " (Error: " & Err.Number & ")"
Resume ExitHere
End Select

End Sub

Oorang
09-11-2007, 06:44 AM
Hi Marsha,
Welcome to the board:) Maybe I am misunderstanding, but when you say "I do not want it to go to the printer on acnormal. It says it is going to the printer, however it does not go to the printer" Those two things seems to conflict? Is the report being opened via the database window or a form? What behavior is it exhibiting that it shouldn't?

All wiyht. Rho sritched mg kegtops awound?

marsha4jesus
09-11-2007, 06:16 PM
Thank you for your response! I resolved the issue by check the recordset for records prior to executing the docmd.OpenReport. Prior to this thought, The Report_nodata event was invoked on both acpreview and acnormal print modes. For acnormal, meaning send to the printer, which was parameter of the docmd.openreport, it would invoke the nodata event in the report module, display the msgbox i coded and also act like it was printing to the pritner. Thanks for your assistance.