These are at the beginning of the code:
Option Compare Database
Option Explicit
I ran the debug and found a missing line.
I have been playing around and not had any luck.
I have a form with a button on it that I want to print the current record on a report.
Using the following code, I get a blank preview and the printer select dialog box, I choose the printer I want to print the report on, but the report prints on the default printer, and the form prints on the selected printer.
Code:
Private Sub PrintPacker_Click()
On Error GoTo Err_PrintPacker_Click
Dim stDocName As String
Dim StrFilter As String
stDocName = "Packer"
StrFilter = "[packer#]=" & Me.packer_
DoCmd.RunCommand acCmdPrint
DoCmd.OpenReport stDocName, acPreview, , StrFilter
DoCmd.OpenReport stDocName, acNormal, , StrFilter
Exit_PrintPacker_Click:
Exit Sub
Err_PrintPacker_Click:
MsgBox Err.Description
Resume Exit_PrintPacker_Click
End Sub
I think I am close, but just don't have the knowledge to finalize it.
Please help.
Thanks