Results 1 to 4 of 4
  1. #1
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38

    Add button to navigation form header to print displayed report

    Hello,



    I am using a navigation form to display reports. I would like to add a command button to the navigation form header which would print the report currently displayed on the form. Ideally it would open the selected report in print preview or bring up the option to select the printer and printer settings. I know how to add buttons to each report to do this, but I would like to have one button in the header of the form rather than a button on each report. I tried the solution described in the link below, but I could not get it to work.

    Suggestions?

    https://www.experts-exchange.com/que...cess-2010.html

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sounds like this should work:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38
    Sorry. I don't get it. The navigation form will have buttons along the side which will display different reports. In the header I want to have a button which opens a print preview of the report currently displayed in the navigation form.

    Code from the link provided:
    DoCmd.OpenReport "SecondReportName", , , "FieldName = " & Me.ControlName

    expression .OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)

    The "ReportName" is determined based on the report currently displayed. How do I indicate the name of the report when it will be determined based on the report currently displayed which can change?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sorry, I misread that as printing the record currently displayed. Behind the buttons that display reports, you could add code to set a public variable, TempVar or form control to the name of the report, then use that in your code.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Error displayed on the navigation form
    By stephenchan433 in forum Forms
    Replies: 1
    Last Post: 11-14-2015, 06:44 PM
  2. Button in form to print 1st page of report
    By LonnieCAR in forum Reports
    Replies: 1
    Last Post: 05-29-2014, 09:08 AM
  3. Replies: 3
    Last Post: 11-15-2011, 06:29 PM
  4. Print Button on a Navigation Form
    By sotssax in forum Forms
    Replies: 2
    Last Post: 09-15-2011, 07:47 AM
  5. Replies: 0
    Last Post: 02-22-2011, 05:04 AM

Tags for this Thread

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