Thanks a million!
http://www.mvps.org/access/reports/rpt0009.htm
--
\\// Live Long and Prosper \\//
BS"D
Thanks!
Private Sub Form_Load()
Dim intCounter As Integer
For intCounter = 0 To Application.Printers.Count - 1
Me.lstPrinters.AddItem Application.Printers(intCounter).DeviceName(),
intCounter
Next intCounter
End Sub
Dennis wrote:
>That link was helpful, but not exactly what I need. I need to display a list
>of printers, and allow the user to select one . I don't need other printer
>properties like paper type, page size, etc. Just a list of names. When the
>user selects a name, that printer is used for the specific report. Access
>2002.
>
>Thanks!
>
>> Check this link
>>
>[quoted text clipped - 5 lines]
>> >
>> > Thanks a million!
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200602/1
Thanks!!
Dim stDocName As String
stDocName = Me.lstReports.Value()
If Len(stDocName) > 0 Then
'open the report in a hidden window
DoCmd.OpenReport stDocName, acViewPreview, , , acHidden
'set up printer
Reports(stDocName).Printer = Application.Printers(Me.lstPrinters.
ListIndex())
Reports(stDocName).Printer.Copies = Me.txtNumCopies.Value()
DoCmd.OpenReport stDocName, acNormal
End if
Its seems a bit convoluted, but it works. There is probably a much better way
of doing it.....
Gina
Dennis wrote:
>Worked like a charm. Now, is there an easy way to set the selection as the
>printer for that report ONLY?
>
>Thanks!!
>
>> Create a form with a listbox on it and use the following code:
>>
>[quoted text clipped - 21 lines]