Results 1 to 5 of 5
  1. #1
    BigBear is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2009
    Posts
    9

    Show Hide Subreport / acViewReport

    When report is opened using
    DoCmd.OpenReport stDocName, acViewPreview, the subreport is shown/not shown appropriately, but I cannot use any of my command buttons.

    When the report is opened using,
    DoCmd.OpenReport stDocName, acViewReport, I can use my command buttons, but the subreport is shown for all records.

    How do I show/hide the subreport using DoCmd.OpenReport stDocName, acViewReport


    Thank you

  2. #2
    rommelgenlight is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    77
    make the record source of your subreport have a criteria based on your main form or you should have your link (master/child) fields.

  3. #3
    BigBear is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2009
    Posts
    9

    Thank you

    I tried that..... it did show/hide the data appropriately, but the sub report object was still visible on records that had no data.

    I decided to go another way.....I put my View, Print, Email and Export to excel buttons on my 'Reports Form' instead of the actual report.

    Thanks for your help. I learned something new. I did not know you could have a query show in its raw form in a report.

  4. #4
    rommelgenlight is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    77
    i see. you want to hide the sub-report form if it has no record on it. maybe you can try on your On NoDate Event of your sub-report form

    Me.Report.Visible = False

  5. #5
    BigBear is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2009
    Posts
    9

    Thanks again

    Tried that. It sounds like something that should work (because it works for subforms), but it didn't. I decided to go a different way with this one. I think having the options on the form before previewing the report may be better.

    I do have another question which I will be posting.
    Thanks again.

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

Similar Threads

  1. Hide zero value in report and date syntax
    By Alex Motilal in forum Access
    Replies: 0
    Last Post: 11-16-2008, 09:11 AM
  2. Replies: 4
    Last Post: 10-29-2008, 11:53 AM
  3. Show some or all
    By protean_being in forum Queries
    Replies: 1
    Last Post: 05-28-2008, 05:33 PM
  4. Replies: 1
    Last Post: 12-06-2006, 05:32 PM
  5. Hide the Database window
    By wasim_sono in forum Access
    Replies: 5
    Last Post: 02-02-2006, 06:41 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