Results 1 to 2 of 2
  1. #1
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160

    Automating printing Dialog Box

    Hi Guys,

    I am working on a billing database. I have a report in which through VBA I am opening another report(PrintBill).
    Using following VBA code:

    Private Sub BillNumber_Click()

    Forms!PrintBill!BillNum = Me.BillNumber
    DoCmd.OpenReport "PrintBill", acViewReport, , "BillNumber = " & Me.BillNumber


    DoCmd.SelectObject acReport, "PrintBill"
    DoCmd.RunCommand acCmdPrint
    DoCmd.Close acReport, "PrintBill", acSaveNo

    End Sub

    This works fine and open the print dialogbox, now there I need to change printer and press OK (Enter or Mouse click), I want to automate this action. I know we can set different printer and page settings for each report and through that the process could be made easy, but the issue is sometimes I use same report to print to default printer and sometimes to other printers (Like MS PDF or cute PDF or Nitro PDF, etc), hence I want the same to be done through the code. Also if we make default setting as required for the report still it needs to press OK (or Enter on keyboard ) I want to avoid that step also.

    Further the report is going to be mostly sent to cutePDF printer, hence after every print command the dialog box asks to save file, also can i also automate it like pressing ENTER key Or SPACE key as required.

    Thanks in advance for your help.
    regards
    Deepak Gupta

  2. #2
    deepakg27 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    160
    Awaiting reply, someone please help & guide.

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

Similar Threads

  1. Replies: 4
    Last Post: 04-17-2019, 03:51 AM
  2. automating lookup
    By NotMyJob in forum Forms
    Replies: 1
    Last Post: 12-20-2018, 10:12 AM
  3. Automating filling out a pdf
    By TerraEarth in forum Programming
    Replies: 3
    Last Post: 04-30-2018, 12:12 PM
  4. Replies: 1
    Last Post: 10-20-2011, 01:34 PM
  5. Automating Reports
    By Christopher in forum Import/Export Data
    Replies: 3
    Last Post: 04-22-2010, 01:40 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