Printer Control

J

Jael

Access 2003, Vista Ultimate

I need to force a report to print from the manual paperbin. The report is
called from a form thaqt seklects one of several label formatted reports and
one so several mailing lists. The labels are in the manual bin of the
default printer (Sharp laser).

referring (coping) to
http://support.microsoft.com/default.aspx?scid=kb;en-us;279506 I came up with
the following code. txtstrCrit is a criteria string that select the mailing
list. The program works with out the printer selection but uses the wrong
bin. The following code will not compile as the "Set Prt = ..." line errors
with a "Argument not Optional".

Reports (...) asks for start date, end date, dbs, tag The web reference
uses the format I used below but it is for access 2002 - is there a change in
this area for 2003?.

Any thought 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top