Results 1 to 4 of 4
  1. #1
    knh2r is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    25

    Updating Subtotal with Dsum expression on new record

    I am using a DSum function on a form control to provide a Subtotal from a query. It works perfectly except that when I go to a new record in the subform I get #error in the Subtotal. As soon as I type anything...a space, letter, etc. the subtotal calculated correctly.

    I would like the subtotal to update and continue showing the correct value after each item is added to the order details subform, and not show error before the next item is entered. I have been playing around with events and if dirty, etc with no luck.

    Here is the expression used in the control source for the unbound textbook Subtotal:

    =DSum('Price","GFQ1","fkOrderID = " & [fkOrderID] & "And fkOrderID =" & [fkOrderID])



    GFQ1 is a query made for the purposes of calculations. My UnitPrice is a calculated field also using a Dmin and Iff function, so I can't use a simpler way to get the subtotal because of the limitation of summing a calculated field.

    Any help is greatly appreciated!

  2. #2
    Bulzie is online now VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Maybe try OnCurrent Event in subform, .SubTotal.Requery ?

  3. #3
    knh2r is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    25
    Thanks for the quick reply. I just tried that with no luck. It just works so well other than that.....any other suggestions?

  4. #4
    knh2r is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    25
    Anybody? I really appreciate the help. This problem is giving me a fit! Ill be glad to post more info, DB, etc. Thanks!

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

Similar Threads

  1. Replies: 9
    Last Post: 03-28-2016, 03:57 PM
  2. Replies: 2
    Last Post: 09-09-2015, 09:45 PM
  3. DSUM Where Expression not working
    By GraeagleBill in forum Programming
    Replies: 3
    Last Post: 02-23-2015, 09:41 PM
  4. Dsum expression help please
    By manos39 in forum Forms
    Replies: 1
    Last Post: 12-12-2011, 05:50 PM
  5. Help with subtotal first record in report
    By leslina76 in forum Access
    Replies: 1
    Last Post: 08-25-2011, 01:54 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