Currently when I print a report (the specific data for the report is chosen from a combo) by a click on a button, the report opens (preview), prints and close again. I use this code for doing so:
I would like to add two things:
1. Can I alter the code, so it just prints, without previewing.
2. If I add a textbox, where user types number of copies to be printed, can that be added as will in the code?
Thanks.
/Anders
Code:
Private Sub cmdPrint_Click()
If Me.cboSelectDate <> 0 Then
DoCmd.OpenReport "rptSJAView", acViewPreview
DoCmd.PrintOut
DoCmd.Close acReport, "rpSJAView", acSaveNo
Else
MsgBox ("Please select a date.")
End If
End Sub
I would like to add two things:
1. Can I alter the code, so it just prints, without previewing.
2. If I add a textbox, where user types number of copies to be printed, can that be added as will in the code?
Thanks.
/Anders