Setting a Printer in the code

  • Thread starter Thread starter jack
  • Start date Start date
J

jack

Hello,

I can't seem to figure out how to find where a print job is
being sent for a particular report. There are two radio
buttons that give an option as to which printer the job is
sent (one is a continuous printer, the other a laser
printer).

When I look at the code all I see is that when Option 1
(for instance) is chosen you have this:

DoCmd.OpenReport"SelectedRolodexCS", acViewNormal

How do I find what printer this is set to (where do I go
from here)? The printers used are not the default printers
since I've changed the defaults in the Setup so I have no
idea how it knows which printer to send the job to.

Thanks in advance,
Jack
 
oHi Jack.
You did not show the print command for the second report.
It could be that the printer was specified in the report design mode.
Open the report in the design view, From the file menu select the page setup
and click on the page tab and see if a specific printer is identified or that
the default is selected.
Hope this helps.
Fons
 
Thank you Fons,

I checked the Page Set-up and it's set for the printer I
wish it to go to...but it still doesn't print to that
printer. It seems there is another command embedded that
bypasses all but a specific printer.
 
This is the event in full.

Private Sub SendToPrinter_Click()

Dim i As Integer

DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
If Forms!SelectPrint_CS.PCnt > 0 Then
' create temp print buffer
Trans_Data_to_PrintBuffer
'For i = 1 To Forms!SelectPrint_CS.PCnt
If PrintOn = 2 Then
DoCmd.OpenReport "SelectedRolodexCS_LQ",
acViewNormal
ElseIf PrintOn = 1 Then
DoCmd.OpenReport "SelectedRolodexCS",
acViewNormal
End If
'Next
End If
End Sub

I can't seem to figure out the printer though.
Thanks again,
Jack
 
Jack.
What does the PrintOn refer to, I am not familiar with this expression. I
still suspect that the printer is incorporated in the report page setup for
these two reports.
Fons
 
PrintOn is the overall name for the two radio buttons where
you can select Continuous or Sheet printing. If you choose
Sheet printing, for instance, the job will print to the
laser printer. In that example it uses the
"SelectedRolodexCS" report for Sheet and
"SelectedRolodexCS_LQ" report for continuous...however,
when I look at those reports (in Page Setup) the printer
selected is not the one it prints on.

Thanks so much for your help,
Jack
 
Jack.
You wrote "> when I look at those reports (in Page Setup) the printer
selected is not the one it prints on."
I want to make sure that you open each report in the design view first and
while open in design view you click on the file > page setup. than click the
page tab, and check the printer setup, this is where I suspect you'll see the
"Use Specific Printer" selection checked, you can check the specific printer
selected by clicking the "Printer..." button.
Fons
 
Thanks for all your help Fons. It's appreciated.
It seems I had to think outside the box a bit with this
one. All my settings were correct as per your suggestions.
I decided to look at my printer drivers. For some strange
reason when I took out my printer drivers and reinstalled
them, everything printed where they were supposed to.
Thanks again for your help,
Jack
 
Back
Top