Results 1 to 5 of 5
  1. #1
    Helen269 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    8

    Subform won't calculate subtotal - nothing to pass to main form.

    Help! I'm doing an Access 2003 database for IT class in Windows XP. We have to pass ALL units or fail the course. So far I'm doing very well but this Access database is not behaving itself and threatens to be the one thing that will fail me.

    I have a form with a subform. The subform allows the user to input items for purchase from a table of products then is supposed to add it all up and present me with an order total.

    In the Order Details form I have:
    OrderNumber
    ProductNumber
    Quantity
    Subtotal =[Quantity]*[Price] - the price is stored on the product info table)

    The field names here are the actual names of the control boxes, not the labels. Just to be clear on that.

    In the subform footer I have a text box with =Sum([SubTotal]) in it that is supposed to refer to the SubTotal box and give me the grand total for a given numbered order. I check to see it's doing what it's supposed to in the Form View but all I get is £0.00 - what's going wrong?



    I've seen this problem in this and other forums and checked from those threads that I'm doing it right and I seem to be but obviously something's not quite right. I'm stumped.

  2. #2
    Helen269 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    8
    If it helps here is a picture of the main and subform together showing the two items on order number 1 which should add up to £35.

    I'll worry about getting the subtotal onto the main form later but in the meantime my order total in the subform in Form view should say £35 but doesn't and I can't for the life of me work out why it doesn't.

  3. #3
    SteveH2508 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Chelsea, London, England
    Posts
    117
    In the subform footer I have a text box with =Sum([SubTotal])
    You cannot refer to the text box in the formula (it is not like Excel) - you need to recreate the formula.
    Like this:
    =Sum([Quantity]*[Price])

  4. #4
    Helen269 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    8
    Quote Originally Posted by SteveH2508 View Post
    You cannot refer to the text box in the formula (it is not like Excel) - you need to recreate the formula.
    Like this:
    =Sum([Quantity]*[Price])
    Aha! Thank you! That kind of works but now in the Form view I have a total for every item in the orders table, not just order no. 1, but at least it's a start.

    I'm hoping that once I figured out how to get the grand total figure to show in the totals box in the main form that it will only show the grand total of each order.

    The order details table has Order Number as its first column so the first two records are order no.1, the next few are order no.2, the next couple are order no.3 and so on. What you have suggested totals everything in that table regardless of which order no. it belongs to.

    Let's see what happens when I (eventually) work out how to get the subform total linked to the main form total...

  5. #5
    Helen269 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    8
    New
    I had to put this into my main form Order Total box:

    =Forms("frm2_CustomerOrder")![frm2_OrderDetails_Subform].[Form].[OrderTotal]

    After MUCH searching and trying various solutions I found this on someone else's thread and adapted it to my field and form names. I would NEVER have figured this out by myself.


    I hate Access 2003.

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

Similar Threads

  1. Totals from subform to main form
    By kathi2005 in forum Forms
    Replies: 4
    Last Post: 11-04-2011, 10:19 AM
  2. Controlling Subform from Main Form
    By SteveF in forum Forms
    Replies: 5
    Last Post: 07-01-2011, 05:32 PM
  3. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  4. Replies: 0
    Last Post: 07-15-2010, 12:32 PM
  5. Replies: 25
    Last Post: 03-31-2010, 11:10 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