Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    label in subreport header (A2k3sp1)

    Hi All,
    I am trying to make a label, located in a subreport header, visible or invisible. In the details section of the subreport, I have a textbox which is visible or invisible dependent on the value of a hidden checkbox. I am trying to use the following code, located in the subreport's Detail On Format event:

    Me.txtMyTextBox.Visible = Me!chkMyCheckBox
    Me.txtMyHeaderLabel.Visible = Me!chkMyCheckBox

    txtMyTextBox will be always be visible for the proper record, however if there is more than 1 record, the visible property of txtMyHeaderLabel is set by the last value of chkMyCheckBox, so it will be visible only if the value of chkMyCheckBox in the last record is true. (It seems to me that the OnFormat event fires for each record in the details section.)

    The recordcount of this subform will be from 1 to ??(usually less than 5, but could very well be more).

    How can I do this so txtMyHeaderLabel will be visible if any of txtMyTextBox is visible?

    Thank you.

    gdr
    ---
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: label in subreport header (A2k3sp1)

    You're going to need to sum the values of the yes/no field for the checkbox for all the records in the subreport and set the visibility of the label based on whether the sum is <> zero. I'm assuming here that the checkbox is actually bound to a yes/no field. If it isn't, you have a different problem.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: label in subreport header (A2k3sp1)

    Hi Charlotte,
    Your assumption was correct.
    Thank You.

    gdr
    ---
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

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