Report printing

A

Amateur

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
 
A

Amateur

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 Missing Data 2
Command Button Not Executing 24
Report printing problem 2
preview a report 5
Opening a Filtered Report from a Form Button 3
print records from listbox 0
search command 2

Top