Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010

    Unanswered: Calculating values across multiple tables


    Officially this is driving me mad .
    I am trying to add a total field to my form Orders.

    I have a couple of queries working out different amounts and then one pulling it all together.
    However when it comes together its putting some really random numbers in there

    I don't think how I have done it is the best way but I can get the rest to work.
    • Product Subtotals works out the subtotals of the items with VAT
    • Total Item Cost bring the value together and groups it buy the Order ID
    • Employee Work Query works out the employee pay * hours worked
    • Employee Pay pulls the totals together the values form Employee work query
    • Total Cost then Adds Total Item cost and Employee Pay together.

    But for some reason the Order ID has multiple values on it that just don't work.

    Does anyone have any ideas how to do this in a simpler method or how to get the correct answer/see where I'm going wrong?
    I'm sure there must be a simpler method surely?

    I've attached my database so you can see whats going on. I've been searching so much and just can't get it right
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    There is nothing in the Orders form that could compute a total. Also the Form class module contains code that is faulty and cannot be compiled:
    Option Compare Database
    Private Sub btn_add_items_Click()
    On Error GoTo Err_btn_add_items_Click()
    DoCmd.OpenForm "Order Details Input", , , "Order ID = " & Me.Order ID ...
    End Sub
    Private Sub Command93_Click()
    Private Sub btn_add_items_Click()
    On Error GoTo Err_btn_add_items_Click
    Dim stDocName As String
        Dim stLinkCriteria As String
        stDocName = "Invoice"
        stLinkCriteria = "[Order ID]=" & Me![Order ID]
        DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
        Exit Sub
        MsgBox Err.Description
        Resume Exit_btn_add_items_Click
    End Sub
    End Sub
    What exactly do you try to do and how?
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts