Tidying my report

A

A Moloney

Hi.
I have the following code on a command button that
automatically prints my report when clicked. Can i modify
this code to automatically print 2 copies of the report
and ignore any blank pages (as report fits on one page
but is printing a second blank page).

Private Sub Print10a_Click()
On Error GoTo Err_Print10a_Click

Dim stDocName As String
Dim strWhere As String
strWhere = "[Date]=#" & _
Me.Date & "#"
stDocName = "10aConfirmation"
DoCmd.OpenReport stDocName, acNormal, , strWhere

Exit_Print10a_Click:
Exit Sub

Err_Print10a_Click:
MsgBox Err.Description
Resume Exit_Print10a_Click

End Sub

Any help appreciated.
 
N

Nikos Yannacopoulos

A simple way to print two copies is to simply repeat the line of code:

DoCmd.OpenReport stDocName, acNormal, , strWhere

Now, on the blank page, this is due to one of two possible reasons:
1. The report width in the design view is wider than the available print
width (total page width - margins), causing overflow to a second page, or
2. One of the report sections (most likely a footer or header section) has
its Force New Page property set to something other than None; reset to None.

HTH,
Nikos
 
A

A Moloney

Thank You so Much Nikos
-----Original Message-----
A simple way to print two copies is to simply repeat the line of code:

DoCmd.OpenReport stDocName, acNormal, , strWhere

Now, on the blank page, this is due to one of two possible reasons:
1. The report width in the design view is wider than the available print
width (total page width - margins), causing overflow to a second page, or
2. One of the report sections (most likely a footer or header section) has
its Force New Page property set to something other than None; reset to None.

HTH,
Nikos

Hi.
I have the following code on a command button that
automatically prints my report when clicked. Can i modify
this code to automatically print 2 copies of the report
and ignore any blank pages (as report fits on one page
but is printing a second blank page).

Private Sub Print10a_Click()
On Error GoTo Err_Print10a_Click

Dim stDocName As String
Dim strWhere As String
strWhere = "[Date]=#" & _
Me.Date & "#"
stDocName = "10aConfirmation"
DoCmd.OpenReport stDocName, acNormal, , strWhere

Exit_Print10a_Click:
Exit Sub

Err_Print10a_Click:
MsgBox Err.Description
Resume Exit_Print10a_Click

End Sub

Any help appreciated.


.
 

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


Top