Report printing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following command button code:
Private Sub prepare_invoicenumbers_Click()
On Error GoTo Err_prepare_invoicenumbers_Click
Dim stDocName As String
stDocName = "invoicenumbers"
DoCmd.RunMacro stDocName
stDocName = "endofmonthinvoicebie30p"
DoCmd.OpenReport stDocName, acNormal
stDocName = "endofmonthinvoiceclientsnonpool"
DoCmd.OpenReport stDocName, acNormal
stDocName = "invoicenumbersdelete"
DoCmd.RunMacro stDocName
Exit_prepare_invoicenumbers_Click:
Exit Sub
Err_prepare_invoicenumbers_Click:
MsgBox Err.Description
Resume Exit_prepare_invoicenumbers_Click
End Sub
If the line:
DoCmd.RunMacro stDocName
stDocName = "endofmonthinvoicebie30p"
get's executed, it's printing an emty report page.
How can I change the code so that, if there is no record shown in the
report, the report does NOT get printed?
Thanks for your help
Klaus
 
Sorry, I posted this one again but I got, as I posted the first version, the
message that I cannot send anything to you .
 
Back
Top