Results 1 to 5 of 5
  1. #1
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128

    Question Hide Report after Opening?

    I have a form that opens two reports. I need to hide one of the reports after it opens. I then need to add a button to the 1st report that makes the 2nd report visible again.



    I know of Me.Visible = False

    This has not worked for me. I placed this in the On Load, On Open, and On Activate events of the 2nd report, but when the reports open from the form, the 2nd is still visible. I am aware that I could close the 2nd report and have the 1st one re-open it, but that would defeat the purpose as I need the values from the form (check background below).

    I was thinking of one solution:

    1) In VBA have the form make the 2nd report invisible once the code to have it open is run. Then have a button on the 1st form to make it visible again. My issue is that I only know how to use Me.Visible. How do I call a report and make it invisible on a different form/report? (In either case I am curious to know how to refer to a report instead of using "Me")

    Any help/insight would be much appreciated. Thank you!

    BACKGROUND:
    The form has two date fields where the user chooses a start and end date. The 1st report bases it's values solely on the end date, while the 2nd report uses the range of dates from start to end. If I close the 2nd report instead of hiding it, then I have to have the user go to another form and click the button to use the same start and end date.

  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
    It would be the same as this:

    Forms Refer to Form and Subform properties and controls

    except you'd use "Reports" instead of "Forms". You can hide it with one of the arguments of OpenReport.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    By the way, if you just open them both in Preview mode, one will stack on top of the other so the user can review one, and when they close it the other will be sitting there. At least that works for me.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128
    So Reports!ReportName should work instead?

    Beyond that, you're a genius! Thank you very much. Didn't even notice that option in the macro.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help. Don't forget to post something wherever you posted this so people don't waste their time.

    cross posters
    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. Hide Null Values in Report
    By rdr910 in forum Reports
    Replies: 10
    Last Post: 03-15-2012, 03:09 PM
  2. Hide Rows in a Report
    By alpha in forum Reports
    Replies: 2
    Last Post: 01-25-2012, 01:27 PM
  3. Replies: 1
    Last Post: 01-10-2012, 03:44 AM
  4. Hide Report on Textbox Value
    By alyon in forum Access
    Replies: 4
    Last Post: 07-29-2011, 11:19 AM
  5. Hide zero value in report and date syntax
    By Alex Motilal in forum Access
    Replies: 0
    Last Post: 11-16-2008, 09:11 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