I have a form called Daily Revenues, in that form a field called Invoice #. I need to print out two copies. I need it to prinnt only on the current record on the form. I am using a command button on the form. The following is the code I have set up through the code building [Event] on the properties butoon of "Invoice Command Button":
Private Sub Print_Invoice_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Invoice"
strWhere = "Invoice #" = " & Forms![Invoice #]"
DoCmd.OpenReport strDocName, acPreview, , strWhere
On Error GoTo Err_Print_Invoice_Click
Dim intCopies As Integer
For intCopies = 1 To 2
stDocName = "Invoice"
DoCmd.OpenReport stDocName, acPreview
Next
Exit_Print_Invoice_Click:
Exit Sub
Err_Print_Invoice_Click:
MsgBox Err.Description
Resume Exit_Print_Invoice_Click
End Sub
I am need real fimiliar with VB Code. I have attempted this many times it works...like one in 20 times and why only then I do not know. Please help....I am Stuck.
.............Thanks
Private Sub Print_Invoice_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Invoice"
strWhere = "Invoice #" = " & Forms![Invoice #]"
DoCmd.OpenReport strDocName, acPreview, , strWhere
On Error GoTo Err_Print_Invoice_Click
Dim intCopies As Integer
For intCopies = 1 To 2
stDocName = "Invoice"
DoCmd.OpenReport stDocName, acPreview
Next
Exit_Print_Invoice_Click:
Exit Sub
Err_Print_Invoice_Click:
MsgBox Err.Description
Resume Exit_Print_Invoice_Click
End Sub
I am need real fimiliar with VB Code. I have attempted this many times it works...like one in 20 times and why only then I do not know. Please help....I am Stuck.
.............Thanks