Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Arkansas, USA
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invisible Header in Report if conditions met (Access 2K)

    I have a report that groups records by a particular field [Unit Number]. The header on this form is visible and I have a control in the header that selects the most recent activity =Max([GMT Created]). I would like to make the header invisible if certain conditions are met. I am looking at something similar to the following, =IIf(Max([GMT Created])>Date()-100,"Insert Formula",[GMT Created]), where Max([GMT Created]) selects the most recent date and where "Insert Formula" is the place I would insert a function that would make the header for this group of records invisible. The detail section has visible set to No. I would utilize a query to accomplish this, but not sure how to only query for the most recent date where there are groups of records with the same value for [Unit Number]

    Thanks in advance for any assistance

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Invisible Header in Report if conditions met (Access 2K)

    I'm not sure I understand your needs, but if your detail section is not visible, and you want to make the header not visible, wouldn't the simpler approach be to not include the records to begin with in your data source for the report - a group by query should allow you to get the Max for each [Unit Number]. If I've misunderstood, please clarify the situation.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Arkansas, USA
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invisible Header in Report if conditions met (Access 2K)

    You may have misunderstood, but I did figure this out last last night. In the group Header section, I wanted to show certain records from the detail section of the group based on a certain formula. For instance, the only difference between the records in the detail section is one field [GMT Created]. I used the header section to list the Max[GMT Created] in order to get the most recent record, in cases where there were multiple records in the detail section. By default, the detail section is not visible, as I just want the record with the most recent date to be displayed on the report. However, I did not want to show the records in the group header if the Max[GMT Created] date was within the last 100 days. I could not exclude these records in the query because doing so would have excluded the more recent records when the query ran and still included the older records resulting in a report that appeared to have records that were older that they actually were (because the newer records were excluded when the query executed).

    What I did was create a macro with conditions that would set the visible property of [Group Header1] to no if the Max[GMT Created] value was >Date()-100 and set the visible property to yes if the Max[GMT Created] value was <Date()-100 or IsNull.

    This works perfectly for what I was seeking. I appreciate your willingness to help.

    Thanks.

  4. #4
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Arkansas, USA
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invisible Header in Report if conditions met (Access 2K)

    Oh, and I forgot to mention, the macro was attached to the event On Format of [Group Header 1] When the report runs, if the Max[GMT Created] value meets the criteria, the header for those records is not visible, while if it doesn't, the record for the group header is shown.

Posting Permissions

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