Results 1 to 14 of 14
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    display on a form the sum of a field

    Hi



    want to display on a form the totals of one filed/columm in one of the tables the form is based on.

    I added a text box to the table and in proporties----data----control source--opened expression builder, selecedt my table under expression elements then under catagoroes selected the field - and from there I am lost as under expression values I see nothing I can relate to Sumtried to input an expression for the sum of all currency values in one columm


    can some one assist

    thanks

    Ian

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You need to put the field in a Form Footer.
    See: http://www.599cd.com/tips/access/form-footer-total-sum/

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    try Sum(YourField) ?

    Can you give us more background on what you are trying to do as a whole? In my mind I don't see why one would need to sum an entire field in a form in one textbox unless it was a continuous form?

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    sorry possible was not sufficiently clear

    I have a simple database for membership of a club so I haveone table for members & addresses, another with their phone numbers & a third with their subscription payments.

    I created a form using the form wizard which displays it all perfectly.

    I just want a field on the form to display the total amount paid in subscriptions

    thanks

    Ian

  5. #5
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Sounds like a report is more suitable, if this I something that you / management is viewing. Or are you actively entering new data in?

    I would go with the report. Then you can right click the subscription payments field, 'Total On' -> 'Sum' and it will do it for you

  6. #6
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    thanks a lot - the tutorial really helped clarify the problem -which is down to my poor explanation!!!;-)

    The form is created using two tables

    the first one show the name/address and is one customer per screen

    Under that is a tabular table in which all the subscriptions for that individual member are shown.

    I want to display the total for all members on that form not just the one on that page

    thanks

    Ian

  7. #7
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Did you try out JoeM's link and put it in the footer?

  8. #8
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    yes I did but it did not seem to work probably my fault

    The form contains the data from the main table, access has put in the other table data as a tabular sub form and this sub form does not appear to have a footer

    I'll try again but I'm beginning to wonder If I've just approached this from totaly the wrong angle.

    Putting it in it's simplest way I want a running total of all moneys paid displayed on the screen all the time.

    thanks

    Ian

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,969
    If you want to sum records of subform, options:

    1. subform set as datasheet - in form view click the subform then click Totals from the ribbon to open a Totals row in the subform

    2. subform set as continuous and controls arranged to look like datasheet, textbox in footer section

    3. subform set as datasheet with textbox in footer section (it will not display in form view), textbox on main form references the invisible textbox of subform

    Note that the sum will not recalculate for last record until leave that field and/or move to another record
    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.

  10. #10
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    THanks a lot - solved the issue and I now understand a bit more!!!

    Couldn't see where in properties the form was listed as Datasheet or continuous but method 1 worked

    cheers

    Ian

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,969
    Look at form Default View property.

    Is your subform container SourceObject a table or query or form?
    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.

  12. #12
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    I realise I'm going to seem very slow but

    If I open the form in design view

    The "top half" shows one record

    within the bottom half is a table laid out "like Excel" which only shows the records linked via the relationship to the client in the main form.

    If I click on the "sub form the property sheet comes up as follows

    Property sheet
    selection type: Subform/Subreport


    the name is child 33

    and then all the properties are below

    But I can see no option for default view.

    The subform/report is based on a table.

    If I highlight the container form the default view is listed as split form.

    I will admit I created this using the form wizard and let Access do all the work.

    Is this why despite setting headers and footers to be shown in the subform they are not shown

    thanks for the help

    regards

    Ian

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,969
    Because you have only selected the subform/subreport container control. A container control can have a table/query/form/report as SourceObject. Look at the container SourceObject property. If the SourceObject is a form or report, click inside the container to select the object. Or go to the navigation pane and open it directly (but not if already open on main report). Forms and reports have DefaultView property.

    Report headers and footers do not show in subform/subreport.

    I avoid the wizards.
    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.

  14. #14
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Really appreciate the quick response

    As you clearly suspected the source object is a table.

    More things to research and learn!

    In the future I will avoid the wizards

    THanks Again

    Ian

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

Similar Threads

  1. Replies: 7
    Last Post: 04-10-2014, 02:22 PM
  2. Display Query field in form?
    By Ray67 in forum Queries
    Replies: 17
    Last Post: 06-01-2012, 12:44 PM
  3. Replies: 1
    Last Post: 05-28-2012, 06:44 PM
  4. Replies: 3
    Last Post: 01-17-2012, 01:04 PM
  5. Display Web Page in a MS Access Form/Field
    By webinteractive in forum Forms
    Replies: 3
    Last Post: 04-01-2011, 03:53 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