Report printing

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
 
G

Guest

Sorry, I posted this one again but I got, as I posted the first version, the
message that I cannot send anything to you .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Report printing 15
Report printing problem 2
Report Missing Data 2
Printing report to PDF file 5
Run Macro command 5
Slight Adjustment needed to Code 3
Previewing a report 7
Command Button Not Executing 24

Top