Hi, Amber.
In access, I created a command button to print the current form. However, I
want it to print two copies
The easiest way to do this is to change the following line:
DoCmd.PrintOut
to:
DoCmd.PrintOut , , , , 2
Or, if you are creating an entirely new button and don't have the button
wizard, then the try the following code to print two copies of the current
form:
Private Sub PrintFormBtn_Click()
On Error GoTo Err_PrintFormBtn_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = Me.Name
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut , , , , 2
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_PrintFormBtn_Click:
Exit Sub
Err_PrintFormBtn_Click:
MsgBox Err.Description
Resume Exit_PrintFormBtn_Click
End Sub
.... where PrintFormBtn is the name of the button. Save the module and
compile the code.
To get the wizards working again, try selecting the "Control Wizards" button
on the Toolbox toolbar (looks like a magic wand dropping three, uh, rocks on
top of three elipses (...)).
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.