Printer choice window

S

SBGFF

I have a form to print tags for kits. It prints the number of tags for each
record according to the number of kits survived. I bring up a batch of tags
to print, but I can't choose which printer to send the batch too. I only
ever had 1 printer so this was not an issue. but now I may have up to 4
printers to speed things up. This code works well except it doesn't give me
the choice of which printer to use.
I tried inserting this code

DoCmd.RunCommand acCmdPrint
If Err = 2501 Then Err.Clear

But when I tried to use it, it prints 1 tag for each record, then it prints
the tags for my coding. So I end up with 1 tag too many for each record. and
that is because in the printer choice window the default number of copies is
1.
Is there a way to pick which printer to use and not have the default 1
number of copies

Thanks for any help Blair

Private Sub Command48_Click()

Dim lngrecordnum As Long
On Error GoTo Blair_Fix
Do
If [Kittags1.98MatingRecords.Kits Survived] > 0 Then
DoCmd.PrintOut acSelection, , , , [Kittags1.98MatingRecords.Kits
Survived]
End If
lngrecordnum = Me.CurrentRecord
[Text53] = lngrecordnum
If [1st Adopted Kits] > 0 Then
DoCmd.OpenForm "KitTags1stAdoptedKits"
DoCmd.Close
End If
If [2nd Adopted Kits] > 0 Then
DoCmd.OpenForm "KitTags2ndAdoptedKits"
DoCmd.Close
End If
DoCmd.GoToRecord , , acNext
Loop
Blair_Fix:
MsgBox "All records are processed."
DoCmd.GoToRecord , , acFirst
End Sub
 
A

Allen Browne

If this is Access 2002 or later, you can set the Application.Printer
*before* you OpenReport.

You can even code it so it remembers the printer to use for the report. See:
Printer Selection Utility
at:
http://allenbrowne.com/AppPrintMgt.html

That article also has a link to a solution for earlier versions.
 
S

SBGFF

Thanks Allen, I,m using 97 so I'll check out Albert's link

Thanks Blair
Allen Browne said:
If this is Access 2002 or later, you can set the Application.Printer
*before* you OpenReport.

You can even code it so it remembers the printer to use for the report.
See:
Printer Selection Utility
at:
http://allenbrowne.com/AppPrintMgt.html

That article also has a link to a solution for earlier versions.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

SBGFF said:
I have a form to print tags for kits. It prints the number of tags for
each record according to the number of kits survived. I bring up a batch
of tags to print, but I can't choose which printer to send the batch too.
I only ever had 1 printer so this was not an issue. but now I may have up
to 4 printers to speed things up. This code works well except it doesn't
give me the choice of which printer to use.
I tried inserting this code

DoCmd.RunCommand acCmdPrint
If Err = 2501 Then Err.Clear

But when I tried to use it, it prints 1 tag for each record, then it
prints the tags for my coding. So I end up with 1 tag too many for each
record. and that is because in the printer choice window the default
number of copies is 1.
Is there a way to pick which printer to use and not have the default 1
number of copies

Thanks for any help Blair

Private Sub Command48_Click()

Dim lngrecordnum As Long
On Error GoTo Blair_Fix
Do
If [Kittags1.98MatingRecords.Kits Survived] > 0 Then
DoCmd.PrintOut acSelection, , , , [Kittags1.98MatingRecords.Kits
Survived]
End If
lngrecordnum = Me.CurrentRecord
[Text53] = lngrecordnum
If [1st Adopted Kits] > 0 Then
DoCmd.OpenForm "KitTags1stAdoptedKits"
DoCmd.Close
End If
If [2nd Adopted Kits] > 0 Then
DoCmd.OpenForm "KitTags2ndAdoptedKits"
DoCmd.Close
End If
DoCmd.GoToRecord , , acNext
Loop
Blair_Fix:
MsgBox "All records are processed."
DoCmd.GoToRecord , , acFirst
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