J
Jael
I have re-posted here after not getting a reply under Reports.
I’m using Access 2003 with Vista Ultimate
I use a form to select one of several reports with data from one of several
mailing lists. I want the selected report to print using the label sheets in
the manual bin of the default printer. The current program works but uses the
wrong bin.
referring to a link supplied in a previous post
http://support.microsoft.com/default.aspx?scid=kb;en-us;279506
I copied the code below. Me.txtstrCrit is a simple SQL string that filters
the mailing list. The code will not compile as the "Set Prt = ..." line
errors with a "Argument not Optional".
When I enter the code in VBA “Reports (…†I’m prompted for “start
date, end date, dbs, tagâ€, not a name. The referenced link uses the format
I used but it is for access 2002 - is there a change in this area for 2003?.
Any suggestions would be appreciated.
Thanks,
Jael
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click
Dim stDocName As String
Dim Prt As Access.Printer
stDocName = "rptMailMerge Labels"
DoCmd.OpenReport stDocName, acViewDesign, , , , Me.txtstrCrit
Set Prt = Reports(stDocName).Printer 'This will not compile
Prt.PaperBin = acPRBNManual
DoCmd.PrintOut
DoCmd.Close acReport, stDocName, acSaveNo
Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
I’m using Access 2003 with Vista Ultimate
I use a form to select one of several reports with data from one of several
mailing lists. I want the selected report to print using the label sheets in
the manual bin of the default printer. The current program works but uses the
wrong bin.
referring to a link supplied in a previous post
http://support.microsoft.com/default.aspx?scid=kb;en-us;279506
I copied the code below. Me.txtstrCrit is a simple SQL string that filters
the mailing list. The code will not compile as the "Set Prt = ..." line
errors with a "Argument not Optional".
When I enter the code in VBA “Reports (…†I’m prompted for “start
date, end date, dbs, tagâ€, not a name. The referenced link uses the format
I used but it is for access 2002 - is there a change in this area for 2003?.
Any suggestions would be appreciated.
Thanks,
Jael
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click
Dim stDocName As String
Dim Prt As Access.Printer
stDocName = "rptMailMerge Labels"
DoCmd.OpenReport stDocName, acViewDesign, , , , Me.txtstrCrit
Set Prt = Reports(stDocName).Printer 'This will not compile
Prt.PaperBin = acPRBNManual
DoCmd.PrintOut
DoCmd.Close acReport, stDocName, acSaveNo
Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub