Results 1 to 6 of 6
  1. #1
    Justin.ITPro is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2

    Form won't calculate totals


    What I am in need of relates to the SubTotal on the Work Order Form screen. If you are testing the database: 1. Open Main Menu form 2. Select Tina Rich from the Contact Dropdowm and click Details. 3. Work Order screen is displayed with correct totals.

    However if you select any other Contact $0.00 shows up for all totals and doesn't calculate from the Work Order Services / Parts SubForms. I am not sure what is causing this issue and need some help... I have attached the referenced database to this thread. [REMOVED... Solved]
    Last edited by Justin.ITPro; 02-07-2014 at 02:24 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,628
    Tina Rich is the only one with data in Parts Total query. This means everyone else has Null for the field in the form RecordSource and simple arithmetic with Null results in Null.

    Really should not save calculated data, especially aggregate data like Parts Total. Should be calculated when needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Justin.ITPro is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2
    Thank you... I have had this problem for 4 days now and you are the first person to actually take the time to look at it and give me a real answer. I have posted this issue on about 5 different forums with no luck. I updated my SubTotal code to:
    =Nz(DLookUp("[Services Total]","[Services Total]","[WOrderID] = '" & [txtWOrderID] & "'"),0)+Nz(DLookUp("[Parts Total]","[Parts Total]","[WOrderID] = '" & [txtWOrderID] & "'"),0)
    How else can I setup my tables to calculate these totals... I figured this was the best way.

    Anyway, Thanks Again!

  4. #4
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Frankly I'd ditch all the DLookups and calculations and put all of your results into a query, then base the fields on the results of the query. It will be easier to handle that way and although not directly relevant to your situation, I've seen some calculated field not work in a form simply due to a bug in Access.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,628
    Xipooo, don't think that will work for the aggregate calcs on form.

    Justin, the Work Order has subforms using tables as SourceObject. Use forms instead and summary calcs can be done in form footer section of each. Then the main form can reference the textboxes on the subforms. That should probably eliminate the DLookups to the aggregate queries.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by June7 View Post
    Xipooo, don't think that will work for the aggregate calcs on form.

    Justin, the Work Order has subforms using tables as SourceObject. Use forms instead and summary calcs can be done in form footer section of each. Then the main form can reference the textboxes on the subforms. That should probably eliminate the DLookups to the aggregate queries.
    Nah, I mean do it on the underlying data. You can do a dlookup on a specific query that grabs the totals for you or even do the math as VBA in the background looking at the forms record source for its data.

    But it sounds like you've got him on the right track.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-11-2012, 10:12 AM
  2. Unusual Sub Totals & Totals in Groups.
    By Robeen in forum Reports
    Replies: 12
    Last Post: 03-20-2012, 08:55 AM
  3. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  4. Month totals and Year totals
    By marksnwv in forum Access
    Replies: 1
    Last Post: 08-05-2011, 10:13 AM
  5. Replies: 1
    Last Post: 12-12-2010, 05:03 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