Results 1 to 12 of 12
  1. #1
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6

    Subform displays #Error when calculating SubTotal.

    Hello and good afternoon,

    I am really struggling here with what should be super simple...i thought. I have created a form using a query that looks at the products table and stockmovements2 table.

    I work out the total by using the Order Qty (Comes from product table) * Sale Price (Comes from product table). The value is then displayed in the Total field on the form.

    However as this is a continuous form i need all of the total to show at the footer.

    I am using Sum([Order Qty] * [Sale Price]) but i get #Error as my result.

    Any help would be appreciated. I didnt create this database i have inherited and trying to improve things.


    I have attached the database, the two forms are POFilled and the subform is called POList.
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by TPrice View Post
    Hello and good afternoon,

    I have attached the database, the two forms are POFilled and the subform is called POList.
    I can't find a form called POFilled
    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
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6
    It is there if you look on the Navigator

  4. #4
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6
    It is there I just searched for it to be sure i told you the correct name

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    you need to put your subtotal calculation in the subform form footer, then refer to these in your mainform control using '=POList.Form.whatever your subform subtotal control is called'

    You can hide the subform footer

  6. #6
    Join Date
    Apr 2017
    Posts
    1,679
    There doesn't exist such form as POFilled! But there exists a form [Copy of POFilled]

    Mu advice is add calculated monetary amount into query QryPo ([TblProducts].[Sale Price]*[Tvl Stock Movements2].[OrderQuantity] AS Amount). Then you can simply sum this calculated field in unbound control in footer of form (but I didn't check this out).

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by TPrice View Post
    It is there I just searched for it to be sure i told you the correct name
    Well I can't see it. I've attached a pic of the forms that I can see.
    Attached Thumbnails Attached Thumbnails NavPic.png  
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6
    Click image for larger version. 

Name:	Screenshot 2022-09-27 143931.jpg 
Views:	18 
Size:	107.5 KB 
ID:	48814

    I have done as you said but there is also error on the main form from this.

  9. #9
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6
    Can you search for it?Click image for larger version. 

Name:	Screenshot 2022-09-27 144143.jpg 
Views:	18 
Size:	9.7 KB 
ID:	48815 Thats the easiest way to find it.
    very strange its not appearing...

  10. #10
    TPrice is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    6
    I have tried this, i can get a total for each line but the SUM of all these produces an error. Click image for larger version. 

Name:	Screenshot 2022-09-27 144359.jpg 
Views:	18 
Size:	84.3 KB 
ID:	48816
    Quote Originally Posted by ArviLaanemets View Post
    There doesn't exist such form as POFilled! But there exists a form [Copy of POFilled]

    Mu advice is add calculated monetary amount into query QryPo ([TblProducts].[Sale Price]*[Tvl Stock Movements2].[OrderQuantity] AS Amount). Then you can simply sum this calculated field in unbound control in footer of form (but I didn't check this out).

  11. #11
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Please have a look at the attached updated file, I used a totals query to get the sale total then a dlookup in your form to leave it updatable.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  12. #12
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Fairly certain that you cannot sum a calculate field - at least that was true at some point in time. That is/was because the values are not stored. The values should come from a table or query, which you'd then sum and do any calculations against that control but show in another control.

    EDIT -To clarify, I mean that the calculated field is in the subform underlying query. I spent a few minutes looking at that and the tables but didn't come up with a way to fix it in that short time.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-29-2017, 03:02 PM
  2. Replies: 3
    Last Post: 06-24-2017, 06:39 PM
  3. Getting a Subtotal from columns in a Subform
    By dweekley in forum Access
    Replies: 3
    Last Post: 05-01-2017, 12:29 PM
  4. Value of Subtotal from Subform Changes
    By GregShah in forum Forms
    Replies: 4
    Last Post: 08-12-2015, 11:40 AM
  5. Replies: 0
    Last Post: 07-15-2010, 12:32 PM

Tags for this Thread

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