Results 1 to 7 of 7
  1. #1
    dkriese is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Calculated Field based on Several Tables or Forms

    I have a form as follows

    Main Form (Client Main)
    Subform 1 (Client Info)
    Subform 2 (Payments/Deposits)

    Main Form is the Client form

    subform 1 are the status and details of clients & info



    subform 2 is/are the payment clients have paid to date (deposits)

    subform 2 gets its data from a payment table/form which lists all payments from all clients - their account numbers posts the payments to their respective subform client info via their account number and accessID number (this works perfectly)

    Now I need to add a total field to show the cumulative payments (totals) for each account number which has been derived from subform 2 and needs to appear in Main form.

    A user selects the client, then clicks on the subform status by year, and then sees all info related to work for that year, I need to calculate the cumulative monies received (could be paid by 5 separate checks)

    Gee I hope I explained this correctly

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You want to show (on the main form) the total of payments in subform2.
    Is this correct?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    dkriese is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Calculated Field based on Several Tables or Forms

    Yes - to explain more, one form/table named PAYMENTS accumulates the payments in a field named AMOUNTS (one per row), I would like it to calculate all the "amounts" and post it to a field named PAR1 in a different table/form.

    I really hope i'm explaining this right.

    There is one table that has "All Payments" which thru a query I get it to post to each client via ClientID and AccountNo.

    so this main table having all the payments, breaks out the individual payments to each client (i'm sure i'm now over explaining)

    So under each client only their respective payments show in rows, giving the check no,.date, amount etc...

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    This is what I think you need to do:

    Create a new text box in the Footer Section of the subform. Let's name this txtTotalAmounts. Its Control Source property should be set as:

    =Sum([NameOfTextbox])
    where "NameOfTextbox" is the name of the textbox that you want to total.

    Set the Control Source property of a text box on the main form to:

    =FormName.Form!TextBox
    where "FormName" is the name of your subform control and "TextBox" is the name of the text box in the Footer Section.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    dkriese is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Calculated Field based on Several Tables or Forms

    That worked thank you!

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Glad to be of help.

    If this helped, please click the scales at the top right of this posting. Many thanks.

    Bob
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    dkriese is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Calculated Field based on Several Tables or Forms

    Again thank you. Now how do I get this total to appear on ther forms. I tried via access 2007 expression builder to reference the forms with the total and get either a blank and error or name?

    On the bottom of the payment form I added your code and it did total payments correctly for each client (whether it be 1 or more payments)

    Now I need that same total to appear on the header of the client info form and on the client main form so that it shows users that the client is paid in full or still has a balance (25 users on a painfully slow access 2007 DB-another separate issue)

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

Similar Threads

  1. Two Forms based on One Table
    By blueraincoat in forum Forms
    Replies: 10
    Last Post: 05-22-2011, 11:17 PM
  2. Auto-Fill one field, two tables, two forms
    By Swilliams987 in forum Forms
    Replies: 1
    Last Post: 01-21-2011, 12:43 PM
  3. Replies: 5
    Last Post: 01-20-2011, 11:36 PM
  4. Replies: 4
    Last Post: 01-19-2010, 05:36 AM
  5. Total based on Formula based on field value
    By cjbuechler in forum Reports
    Replies: 15
    Last Post: 07-10-2009, 09:56 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