Results 1 to 6 of 6
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Set Default Printer

    Access 2000 - how can I set the default printer when a report loads and change it back to the original printer when the form closes? I tried this


    Code:
        Set Printer = Printers("Adobe PDF")
        Set Printer = Nothing
    But it hits the Printers and throws an error of Sub or Function Not defined.

    Also, I do not want to give the user a choice of selecting printer, I want it to be set totally from the VBA

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    This is not setting defaut printer. Setting default printer means setting it and leaving it as DEFAULT.
    you want to change the destination printer of the report.
    to force the report to the printer you want...

    Code:
    dim rpt as report
    sRpt = "rRpt"
    DoCmd.OpenReport sRpt, acViewDesign
    Set rpt = Reports(sRpt)
    Set rpt.Printer = prtTarget 
    DoCmd.OpenReport sRpt  'print
    DoCmd.close acReport, rpt.Name, acSaveNo    'dont save
    Set rpt = Nothing

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    It looks to me like the printer I want to use is prtTarget. Where do I set prtTarget?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    what is the command to get the report to autoprint? acprint is not working

  6. #6
    jtgarrison is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2013
    Posts
    2
    DoCmd.OpenReport "ReportName", acViewNormal

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

Similar Threads

  1. Change default printer
    By LonghronJ in forum Modules
    Replies: 2
    Last Post: 02-03-2016, 03:01 PM
  2. Select Default Printer
    By pkstormy in forum Code Repository
    Replies: 4
    Last Post: 03-10-2015, 09:26 AM
  3. Replies: 3
    Last Post: 02-25-2014, 11:46 AM
  4. Print to Default Printer
    By bsc0617 in forum Access
    Replies: 7
    Last Post: 10-10-2013, 07:46 AM
  5. Trying to Change Default printer
    By sims.anderson2010 in forum Programming
    Replies: 2
    Last Post: 03-08-2012, 08:07 AM

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