Results 1 to 7 of 7
  1. #1
    gibby is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4

    if statement works in detail section of report, but not in the group header section

    I have a report that groups equipment by employee. If the checkbox field [OffCampus] is checked, I want an astrisk beside the piece of equipment - this works in the detail section for all the records with OffCampus checked. Textbox =IIf([OffCampus]=True,"*","").
    In the header section I have another Textbox
    =IIf([OffCampus]=True,"*OffCampus Address",""). This textbox works for some some of the employees that have offcampus equipment, but not for others. I don't understand why the if statement works in the detail section, but not in the header section. Can someone point me in the right direction? Thanks


  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    What do you mean by 'doesn't work' - error message, wrong results, nothing?

    In the header section the calculation is probably happening with the first record in the group.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gibby is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4
    the ones that don't work just show blank. If the statment is stopping on the first record, how do I tell it to continue through all the records belonging to an employee?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Isn't that what happens in the Detail section?

    Don't understand what you want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    gibby is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4
    I want the text box calculation field in the group header to go through all the records that belong to an employee to see if the [OffCampus] field is checked. I believe you are correct that the calculation stops on the first record of each employee. My calculation is entered in the Control Source of the text box. I don't know what kind of code I should write to get that calculation to look through all an employee's records. Thanks

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    So you want to show something in header that can be deduced by looking at the detail section records?

    In header textbox try:

    =IIf(Sum(IIf([OffCampus],1,0))=0, "None Off Campus", "One or More Off Campus")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    gibby is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4

    Smile Thanks so much - that worked!

    Thanks for your help!

    Quote Originally Posted by June7 View Post
    So you want show something in header that can be deduced by looking at the detail section records?

    In header textbox try:

    =IIf(Sum(IIf([OffCampus],1,0))=0, "None Off Campus", "One or More Off Campus")

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

Similar Threads

  1. Columns in Report Detail Section only
    By gg80 in forum Reports
    Replies: 10
    Last Post: 08-03-2014, 07:41 PM
  2. Replies: 4
    Last Post: 03-05-2012, 03:25 PM
  3. Count in detail section of a report
    By ccordner in forum Reports
    Replies: 9
    Last Post: 02-08-2012, 06:55 AM
  4. The length of detail section of a report
    By blueraincoat in forum Reports
    Replies: 2
    Last Post: 04-06-2011, 12:24 AM
  5. Replies: 1
    Last Post: 10-11-2009, 08:31 PM

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