Results 1 to 2 of 2
  1. #1
    vinchi1974 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2012
    Posts
    1

    Choose Printer Tray with a VBA Code

    I need a VBA code to let me choose to which tray i would like the report to print.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Google: Access VBA select printer destination tray

    Review the links in http://answers.microsoft.com/en-us/o...f-7c8e15f3bcd2

    The information is focused on Word but much of it will also apply to Access.

    Example code from my db:
    Code:
    'open report in preview mode because is only way to change bin and/or printer destinations
    DoCmd.OpenReport strReport, acViewPreview, , "Submit.LabNum='" & strLabNum & "'", acWindowNormal
    If Application.Printer.DeviceName Like "*HP4K*" Then
        'Set the report destination paper bin to Tray 2
        'Use number not name, cannot exceed 250
        Reports(strReport).Printer.PaperBin = 2
    End If
    DoCmd.PrintOut acPages, 1, 1
    DoCmd.Close acReport, strReport, acSaveNo
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Select Default Printer
    By pkstormy in forum Code Repository
    Replies: 4
    Last Post: 03-10-2015, 09:26 AM
  2. Trying to Change Default printer
    By sims.anderson2010 in forum Programming
    Replies: 2
    Last Post: 03-08-2012, 08:07 AM
  3. connect MS Access with fiscal printer
    By denkovski in forum Access
    Replies: 2
    Last Post: 02-13-2012, 11:43 AM
  4. Forms to Printer
    By Roland in forum Reports
    Replies: 1
    Last Post: 11-22-2010, 10:16 AM
  5. Printing to an intermec printer from access
    By dkalsow in forum Programming
    Replies: 3
    Last Post: 12-16-2009, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums