Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    5

    Thumbs up Unanswered: Setting Subreport visible to False

    Hello!
    I am having a problem setting the visible property of a subreport to FALSE.
    I have a form that i use to run the report and set a few options before execution. I have a check box that i want to use to show the subreort...

    if(IDC=-1)then
    Report!Rpt_Print_Roadmap!rpt_SubChanges.Report.Vis ible=True
    else
    Report!Rpt_Print_Roadmap!rpt_SubChanges.Report.Vis ible=False
    End if

    What's the correct way to do this????
    Thanks
    Last edited by GaryElwood; 09-23-11 at 12:03. Reason: Problem Solved!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You cannot change the visual aspect of a report when its rendition is completed. If you try to use this code when the report is open, it's too late. This must be done before the report leaves the Open or Load event (not sure which one).

    You could possibly reopen the report in Design mode, change the Visible property then re-reopen it in Preview or Normal mode, but this would be rather awkward. Or you could open it in Preview or Normal mode with an argument in OpenArgs that would specify whether the subreport must be visible or not. You would process the contents of OpenArgs in the Open event of the report and set the Visible property of the subreport accordingly.
    Have a nice day!

Posting Permissions

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