Results 1 to 8 of 8
  1. #1
    mommasgonna is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Location
    Tennessee
    Posts
    4

    Trouble with Conditional Function in Report Page Footer


    I am struggling with building and If Then statement in my Report Footer. I have a report that pulls data from two tables...Students and Homeroom. This gives me a list of the students in each homeroom class and they are separated by homeroom. I would like to use a function in the page footer that counts the number of students who are members of our PTSA organization and then returns a percentage based on the total number of students in each homeroom class.



    In the Report, I have on each page:
    Page Header: Homeroom, LastName, FirstName, FamilyID
    Details: LastName, FirstName, FamilyID

    What I need is for the function to look at the FamilyID field and determine is there is any value entered. Then I need a count the total number of records in that homeroom and the total number of records with a value, so I can then get a percent of how many students actually belong to the PTSA in each homeroom.

    I have tried and failed and am

    Thanks for any help anyone can offer!!!

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    1) IIF(NZ([FamilyID],0)>0,1,0) will get you a 1 for each student with FamilyID set, 0 otherwise.
    SUM of that for the homeroom will give you the number of students with FamilyID set.
    COUNT of that for the homeroom will give you the total number of students in the homeroom.
    You might also use DSUM and DCOUNT respectively, depending on where you are putting the calculation.


    2) I don't know why the fields other than Homeroom are on the Page Header, since those are detail fields in this example.

  3. #3
    mommasgonna is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Location
    Tennessee
    Posts
    4
    This is what I have (.jpg image attached). The results I am getting are not what I expect, though. When I open the report in print preview mode, I am prompted for input on the field that contains the IIF function. The SUM expression is not adding up the total value for the field, it seems to be counting the number of students, not summing.

    http://i1166.photobucket.com/albums/...portdesign.jpg

    I am quite rusty with all of this. I took the last 14 years off...lol. I used to be a Microsoft Office User Specialist back on the 97 and 2000 versions of all of the office products. I feel like a dunce right now!

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    If you are still having trouble with this, I may be able to take a look at on Saturday. You can delete all of the private data and upload a sample in a compressed file.

  5. #5
    mommasgonna is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Location
    Tennessee
    Posts
    4
    I think I got it! I got to sit down yesterday and really focus and I have all of the calculations in place. Just need to get the format done. Thanks again for the help! The suggestions from Dal Jeanis helped clear out the cobwebs! I appreciate all the willingness to help! I also got some great tips from another forum...not feeling quite as inadequate anymore! LOL
    Last edited by mommasgonna; 10-04-2013 at 10:29 AM. Reason: typo

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Post #2 sure looked like solid info to me. Glad you were able to make it work! If you feel the problem has been resolved, go ahead and mark this thread "Solved".

  7. #7
    mommasgonna is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Location
    Tennessee
    Posts
    4
    I have no idea how to mark it solved...I am new to this board.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    At the top of this thread, under the thread title and to the right, there are thread tools. Use the "Thread Tools" menu to select the "Mark this thread as solved" option.

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

Similar Threads

  1. Report Page Footer Problem in print
    By farzad_1354 in forum Reports
    Replies: 7
    Last Post: 07-21-2013, 12:16 PM
  2. Report Conditional Page Break (not!)
    By waltb in forum Reports
    Replies: 8
    Last Post: 02-06-2012, 03:43 AM
  3. Page Breaks and the Report Footer
    By dssrun in forum Reports
    Replies: 4
    Last Post: 05-03-2011, 03:23 PM
  4. Trouble Summarizing in Group Footer
    By Millerguitarworks in forum Reports
    Replies: 2
    Last Post: 12-07-2009, 06:06 AM
  5. Replies: 0
    Last Post: 02-11-2009, 06:43 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