• Access 2007 Report Header

    Author
    Topic
    #497253

    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

    Viewing 1 reply thread
    Author
    Replies
    • #1474762

      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

    • #1474767

      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.

      • #1475033

        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

    Viewing 1 reply thread
    Reply To: Access 2007 Report Header

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: