Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Access 2007 Report Header

    All,

    is it at all possible to set the visible property to a label or txt box in a report header based on criteria in a txt box in the detail section of the report ?

    Example:

    The detail section of the report contains a text box set to "yes" or "no"...
    I want a text box or label in the report header to be visible if any one of the records in the detail section is "yes" or "true"...
    If report contains all "no" or "false" in that detail record then I do not want the report header field to be visible...

    I can accomplish this with in the detail section of the report if i set visible to true within a field in the detail section using the OnPrint Event, but cannot make it work seem to impact a field in the report header based on same criteria

    I hope I made this question clear enough

    thank you
    Kevin

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Is this even possible... 2 hours searching google and I cannot find any place where a specific control within a report header is referenced from the detail section or vice versa
    Kevin

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    It seems to me it should be possible - using VBA, I would do it on the OnFormat event for the report, and actually use DAO to cycle through the data source for the detail section to see if I find one or more records that are Yes, and then set the visible property of the header section. But it may be possible to actually do it using a trick where you have a hidden control that contains the sum of the Yes/No field across all of the records in the Detail section, and set the value to be displayed in the text box that way, avoiding any VBA at all. That presumes that you actually have a Yes/No field in the record, and that the sum would be zero if there were no Yes records.
    Wendell

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Wendll,

    that is exactly what I am looking for thank you... if one or more of the detail records show a "yes" in the field then the whole report has to be labelled different than if none of the records show "yes" in the field... I wanted to accomplish this by an invisible label that gets set to visible if detail records contained "yes"... the Yes/No field is contained in the detail... I had not thought about the hidden sum field, i presume something as simple as If statement that sum is greater than or equal to 1, then set visible property to true, and do this in the OnPrint or OnFormat event of the header itself
    Kevin

Posting Permissions

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