Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Set Specific Printer (Access 2003/SP 2)

    What is wrong with this code?
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim prt As Printer
    ' Get the Printer object for the selected printer.
    Set prt = Application.Printers("Large Zebra TLP 2844")
    ' Set the selected printer as the default printer for this session.
    Set Application.Printer = prt
    End Sub


    Or am I way off track? To make a long story short, I tried to set up our Zebra printer to run off an HP JetDirect server and those 2 are incompatible I concluded after calling Zebra Tech Support and HP Tech Support and spending about 2 days working with it, so I put the Zebra on my computer and shared it so the other computers on the network can print to it.

    I had it on another networked computer before trying to put it on the HP server, but due to desk space restraints, I put it on my computer where I am close to plenty of space. Now it will print wonderfully off my computer, but not off the other computers. When I'm done with an order, I have a command button that prints a checklist of the order on a 8-1/2 x 11 paper on an ink jet printer (that prints fine on any computer), and an address label on the Zebra printer. In design view I have set the (label) report printer to the Specific Printer (Large Zebra TLP 2844). Interestingly, on all computers when I mouse over the report, it shows that it is set to that printer, but any time I try to print that label I get the top message in the included picture. If I try to open the label report individually and print it, I get the bottom message on the pictures.


    Clueless in Kansas.
    Attached Files Attached Files

  2. #2
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    I think I figured out the problem, although I can't fix it.

    I always make an .mde file to put on the networked computers and apparently the encryption process is 'hiding' the printer. I copied my .mdb file to the other computers and everything works fine.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    Do you have a specific reason for putting the code in the On Print event of the Detail section? This means that you'll be setting the printer over and over and over again for each individual record!

  4. #4
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    Yep. Ignorance on my part. Where do you put it?

    At this point I'm just using the .mdb file as I mentioned earlier, but if there is a workaround I'd like to use the .mde file.

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    The code in the .MDE file is compiled and stored that way so you will not be able to change it. The solution is to change the code in your .MDB file and then when working, recreate the .MDE.
    Regards,

    Gary
    (It's been a while!)

  6. #6
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    Regarding setting the printer. You could do it two different ways.

    If the database opens with a splash screen or to a particular form, you could set your printer in the on open event of the form such that all reports would use the printer you set. You could then reset the printer back to the default upon exiting the database.

    The other option, as I do not know how the db opens or your print requirements, is to set the printer at the on open event of the report. (We sometimes do this as we have different printers that print various sized paper and/or colors). I would use the main startup screen on open event so you only have to set it once if that meets your requirements.
    Regards,

    Gary
    (It's been a while!)

  7. #7
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    I understand that you can't change code in .mde. I concluded that one of the latest patches for Office is messing up the encryption process. I have encrypted my database for probably 2 years everytime I make changes or add something and have had no problems with my printers. Just now I've had problems.

    Thanks everyone for your suggestions.

  8. #8
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Set Specific Printer (Access 2003/SP 2)

    I follow your thought of setting the default printer on opening the main screen, but I have to use 2 different printers for an order. An inkjet for my checklist and a label printer for the labels.

    I'll try setting the printer on the On Open event of the report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •