Results 1 to 5 of 5
  1. #1
    JonathanT is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    72

    Expressions in a Report Group Header

    I'm wondering if its possible to create a specific expression in a group header. My records all have a field called [Temperature]. In a report I'd like to have group headers that show/group all records where [Temperature] falls between two values. In other words show all records where the [Temperature] is between 90 and 75 in one header and between 74 and 50 in a second header and between 49 and 30 in the last header. Is this possible?

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,924
    I would create a calculated field in your report query called RepGroup that provides you something to group on in the report.
    Something like

    RepGroup: IIf([Temperature] Between 30 And 49,"Last",IIf([Temperature] Between 75 And 90,"First","Second")

    The possibly better alternative would be to put the bandings into a table and then use that in the query to get your group value.
    The table approach means if you want to adjust things you are only changing the values in the table not fiddling with your query or code.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9,132
    don't think you can use between in vba, need to use

    Temperature <= 90 and Temperature >= 75

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,924
    @Ajax - I meant in the reports underlying query, where I think you can use between, but it was Air Code
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    JonathanT is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    72
    Thanks Minty,

    The calculated field worked great

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Add button in report group header
    By bilalo in forum Reports
    Replies: 2
    Last Post: 03-28-2020, 08:07 AM
  2. Replies: 1
    Last Post: 04-06-2014, 10:58 AM
  3. Replies: 0
    Last Post: 02-25-2013, 04:43 PM
  4. Header expressions?
    By brownk in forum Reports
    Replies: 1
    Last Post: 05-15-2012, 12:12 PM
  5. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums