Results 1 to 3 of 3

Thread: Dynamic Reports

  1. #1
    Join Date
    Apr 2002

    Unanswered: Dynamic Reports

    I was wondering if anyone could tell me if there is a way to get Access to choose which subreport to display based on a criteria.

    For example:

    You have Subreport A and Subreport B

    If Subreport A is empty (fields are null)
    the display Subreport B
    else display Subreport A

    Thanks for your help!

  2. #2
    Join Date
    Apr 2002

    Suggest you have a look at the keywords "HasData" and "CanShrink", maybe your clue lies there.

    Access Help mentiones "HasData" as a means to hide a subreport when it has no data in it. The syntax looks like:
    Me!ElementSubRapport.Visible = Me!ElementSubRapport.Report.HasData
    See the Help-file for the proper place to put this code.

    Apart from this, I often use the CanShrink-property for the control on the main report that holds the subreport, to minimise the subreport when it is empty.


  3. #3
    Join Date
    Apr 2002
    Thanks for your help.

    I couldn't actually get what you siggested to work but I did find a work-around. This works for me because Subreport A is always bigger than Subreport B .

    This being said, I just placed Subreport A on top of Subreport B and when Subreport A contains no data, it is simply not displayed therefore displaying Subreport B.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts