Results 1 to 6 of 6
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Getting the Totals

    I have created a main form (A) where in what is included a subform (B) with totals.



    Subform shows:
    Unit Price (Number)
    Quantity (number)
    Total Price (Unit Price x Quantity)

    On the main form - there is a field that is for discount and Grand Total

    The Grand total should show the formula
    Grand Total = Total Price (which is in the subform) - Discount

    As a sample:

    SN Unit Price Quantity Total Price
    1 2.00 8 16.00
    2 3.00 9 27.00
    3 4.00 10 40.00

    Discount : 8.00
    Grand Total : 32.00

    How can i get the Total Price from the subform and show it to the main form.

    Thank you in advance

    Trident

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    How can i get the Total Price from the subform and show it to the main form.
    Create a textbox in the footer section of the subform to calculate the total. Name it TotPrice. Set its record source property to =Sum([Total Price])
    Total Price should be the name of the textbox which shows the line total.
    Create a textbox on the Main form and set its record source property to reference the textbox called "TotPrice" on the subform footer.
    We would need to know the name of the main form and the subform control to help more but would be something like:
    = Forms.[NameOfMainForm].[NameOfSubformControl].Form.TotPrice
    Last edited by Bob Fitz; 11-24-2016 at 02:11 AM. Reason: More info
    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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    you can refer to the subform directly, so instead of

    = Forms.[NameOfMainForm].[NameOfSubformControl].Form.TotPrice

    you can use

    = Me.[NameOfSubformControl].Form.TotPrice

  4. #4
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    I followed the instruction to the letter bu still #ERROR appears:

    1. created a textbox in the subform footer and named it TOTPRICE
    1.1 entered formula for TOTPRICE=([TOTAL PRICE])

    2. created a textbox in the main form and named it GrandPrice
    2.1 entered the same formulas as shown above but still #ERROR

    When I checked the properties, there is no RECORD SOURCE PROPERTY. in the Data, there is only Source Property and this is where I placed the formulas.

    No result, where is my error. I really can not see it.

    Help Please.

    Trident

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    not quite

    1.1 entered formula for TOTPRICE=([TOTAL PRICE])

    should be

    1.1 entered formula for TOTPRICE=SUM([TOTAL PRICE])

    If that doesn't work, try

    =SUM([Price]*[Quantity]) - changing names to match yours

    not clear from your post but it does need to be =SUM(....

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    Also

    2.1 entered the same formulas as shown above but still #ERROR

    should be

    = Forms.[NameOfMainForm].[NameOfSubformControl].Form.TotPrice

    or

    = Me.[NameOfSubformControl].Form.TotPrice

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

Similar Threads

  1. Query detail totals vs. Summary Totals do not match?
    By aellistechsupport in forum Queries
    Replies: 9
    Last Post: 01-15-2016, 11:36 AM
  2. Similar to totals and Grand totals
    By Thompyt in forum Reports
    Replies: 14
    Last Post: 01-24-2015, 06:39 PM
  3. Unusual Sub Totals & Totals in Groups.
    By Robeen in forum Reports
    Replies: 12
    Last Post: 03-20-2012, 08:55 AM
  4. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  5. Month totals and Year totals
    By marksnwv in forum Access
    Replies: 1
    Last Post: 08-05-2011, 10:13 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