Have On Click Command Print Report 2 times

B

bellca

I am added the code that is currently used to print a
report from a command button, on click. I need to know
what to add, to make the report print twice instead of
once.


Private Sub Print_Welcome_Letter_Click()
On Error GoTo Err_Print_Welcome_Letter_Click

DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord

Dim stDocName As String
Dim Link1 As String
Link1 = "[Serial] = Forms![Tracking_Dates]![Serial]"

'If State = "TX" Then
' stDocName = "Welcome_Letter_TX"
'Else
stDocName = "Welcome_Letter"
'End If

DoCmd.OpenReport stDocName, acNormal, , Link1

Exit_Print_Welcome_Letter_Click:
Exit Sub

Err_Print_Welcome_Letter_Click:
MsgBox Err.Description
Resume Exit_Print_Welcome_Letter_Click

End Sub
 
N

Nikos Yannacopoulos

Just repeat the line:
DoCmd.OpenReport stDocName, acNormal, , Link1
one more time.

HTH,
Nikos
 
G

Guest

Thanks,
I thought about that, but wasn't sure. It works.

Carol
-----Original Message-----
Just repeat the line:
DoCmd.OpenReport stDocName, acNormal, , Link1
one more time.

HTH,
Nikos

I am added the code that is currently used to print a
report from a command button, on click. I need to know
what to add, to make the report print twice instead of
once.


Private Sub Print_Welcome_Letter_Click()
On Error GoTo Err_Print_Welcome_Letter_Click

DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord

Dim stDocName As String
Dim Link1 As String
Link1 = "[Serial] = Forms![Tracking_Dates]! [Serial]"

'If State = "TX" Then
' stDocName = "Welcome_Letter_TX"
'Else
stDocName = "Welcome_Letter"
'End If

DoCmd.OpenReport stDocName, acNormal, , Link1

Exit_Print_Welcome_Letter_Click:
Exit Sub

Err_Print_Welcome_Letter_Click:
MsgBox Err.Description
Resume Exit_Print_Welcome_Letter_Click

End Sub


.
 

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

Top