Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91

    Totals in a subform (continuous Form)

    Hi
    I hope someone can help me on this.
    I have a subform that is filtered from the main form by department or student, when I filter by department I want it to show the total number of ticked boxes in the footer of the subform.


    I have the following
    Code:
     =Sum(IIf([tbc]=True,1,0))
    in the controlsource for the box which is in the footer of my subform, however it reads zero until the ticked boxes are visible on the form and then it shows the total, in this case three. I have checked the subform properties and the code is working so have run out of ideas as to how to get this to work.

    Thank you

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if your TBC field is a yes/no field see if something like

    =abs(sum(tbc) )

    works better

  3. #3
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Thank you, I have tried the code an yes my TBC is a yes/no field but it still isn't working.

  4. #4
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    The sub form calculates fine, its when it is put in with the main form if that helps...... I notice that the subform is only displaying each student record at a time, ie it reads record 1 0f 4 when the main form is reading 1 of 18.

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    your record counts don't mean anything really, 1/4 and 1/18 means you have 4 main records and you're on the first one of those, 1/18 means you're on the first of 18 records for the first main record.

    You may have to put a text box on the main form that totals the items in the subform to solve this (dsum may be the easiest method if you're a neophyte)

  6. #6
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Thank you, I think the problem was that it was not filtering the form correctly so I have sorted that part except it will only work on one box. I have a main form that contains the two unbound combo boxes, one listing course codes and the other student ID. Using the Master/child fields I can link one of the boxes, but not both, to the sub form to filter out the information. I have been working on this for a while and do not seem to have found an answer as yet. I am not an advanced user in Access so am in new ground here. Once I get them to filter correctly it will total, as, when I change the master child links between the two search fields all works ok..... Finding this so frustrating lol

    Thank you

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Is your problem solved then?

  8. #8
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Well, partly, now the probelme is getting both combo boxes to link to the sub form. I can link one or the other using the parent/child link and they work perfectly but not together. I can assume from that that the code must be ok but cannot understand why it will not let me put the two fields in.

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you can't link a subform to an unbound main form. You're better off using your unbound controls as selection criteria for the main form and requerying your data based on the information in your two unbound combo boxes.

  10. #10
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Why do they work individually? ..... As you can see I'm a true novice.

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you about you provide a sample of your database because I don't think we're talking the same language. Make it a version prior to 2010 if you please.

  12. #12
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Thank you, I am struggling to get it to down load at the moment, I have sent a pdf screen shot of the form if this helps, at the moment it is set to filter on course and works perfectly. I have had to change it to a main form and subform as I have a calculation box and warning message which need to be activated through the filter, originally the warning message was coming up every time they entered the database.

    I will try to have another go at downloading the database but thought this would give you an idea as to what I am trying to achieve, Thank you for taking the time to help on this, I am really struggling to get this to work.

    Thank you again

    Doc2.pdf

  13. #13
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    A screen shot does not help.

    If your database does not contain any restricted information just compact/repair it then zip it up

    If it does contain restricted information create a copy of the database, change anythin gthat would be considered sensitive (customer names, people names, etc) to something bogus and just leave enough information in the database to simulate your problem then compact/repair the copy and zip it up and upload it through this website's 'go advanced' interface.

  14. #14
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Hi
    I have managed to get the file to download, thank you. The form I am working on at present is Functional Skills Entry Level Course, as you will see the link works perfectly with the course search button but I really need to have them both working. There are hidden calculation boxes in the footer of the sub form and this is why I have split it from being a main form to a main and sub as they were calculating as soon as you opened and bringing up the warning message, this seems to have cured the problem if only I could get both boxes to work..... Thank you so much for looking at this for me any help would be greatly appreciated.
    Attached Files Attached Files

  15. #15
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    can you convert it to 2007 or earlier please I can't open 2010 files.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Continuous Form Totals Problem
    By burrina in forum Forms
    Replies: 2
    Last Post: 02-22-2013, 02:35 AM
  2. Replies: 6
    Last Post: 11-18-2012, 12:54 PM
  3. Totals from subform to main form
    By kathi2005 in forum Forms
    Replies: 4
    Last Post: 11-04-2011, 10:19 AM
  4. Adding totals to a form from a subform
    By Niki in forum Access
    Replies: 13
    Last Post: 05-13-2011, 12:17 AM
  5. Replies: 4
    Last Post: 01-14-2011, 10:37 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