Results 1 to 8 of 8
  1. #1
    bkirsch is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    39

    One to Many Relat. Main/Sub Form calculations

    I have created a database with a one to many relationship to track customer orders for billing purposes. Is there a way to create a sum if statement in the main form to sum total order $ for EACH customers unbilled orders in the subform?



    Thanks for the help.

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Sure. How do you indicate that an order is unbilled? What is the name of the dollar amount field that you want to sum?

    An easy way is to put the sum in the subform header or footer section.

    Another way is to use the DSum in a text box on your main form.

  3. #3
    bkirsch is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    39
    Billed field is a check box and the field I want to sum is "Inventory $$ Allocated"

    Thank you so much!

  4. #4
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    in the subform footer create a text box control and in the control source property put

    =sum(iif(Billed,0,[Inventory $$ Allocated]))

    Now, if you want the field on your main form, just hide the subform footer section and put a text box control on your main form with control source

    =MySubformControlName.Form!MySumFieldName

    You'll have to change MySubformControlName and MySumFieldName to their respective names.

  5. #5
    bkirsch is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    39
    That equation calculates unbilled for all customers in the subform table...is there an equation that will calculate unbilled for each individual customer (one to many relationship) ??

  6. #6
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Is you subform linked to the parent form record? What are the subform "link parent fields" and "link child fields" property values set to?

  7. #7
    bkirsch is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    39
    I have them linked through a one to many relationship based on a "Company" field...is this the information you are looking for?

  8. #8
    bkirsch is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    39
    Figured it out! Thanks for all the help today; I really aprpeciate it!

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

Similar Threads

  1. setting up a form (calculations)
    By donnan33 in forum Forms
    Replies: 1
    Last Post: 12-22-2011, 11:17 AM
  2. Performing calculations in the form.
    By mulefeathers in forum Forms
    Replies: 4
    Last Post: 12-07-2011, 10:47 AM
  3. Help with small form calculations
    By Nokia N93 in forum Access
    Replies: 3
    Last Post: 12-06-2011, 06:29 AM
  4. Form/Subform Calculations
    By sidewayzalex in forum Forms
    Replies: 0
    Last Post: 08-15-2011, 01:11 PM
  5. Calculations in a form
    By elmere in forum Forms
    Replies: 3
    Last Post: 04-27-2011, 04:11 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