Results 1 to 5 of 5

Thread: Totals (2003)

  1. #1
    New Lounger
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Totals (2003)

    I'm trying to total the results of 5 queries by putting them all as subforms within a form. I'm using combo boxes in the footer for calculations, but I'm just getting an error when I bring up the form view. Here's a sample of the calculations:
    =Count([sfrmGiK_Received].[InventoryID])-Count([sfrmGiK_Less].[InventoryID])-Count([sfrmGiK_Shipped].[InventoryID])
    Am I just trying to do something I shouldn't be?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Totals (2003)

    I don't understand why you would use a combo box for calculations. (Neither do I understand what your calculation tries to do)
    Apart from that, make sure that you use the name of the subform as a control on the main form - this is not necessarily the same as the name of the subform in the database window.

  3. #3
    New Lounger
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Totals (2003)

    By combo box I meant text box (whoops) and the calculation is attempting to make a total count of items on hand by calculating ItemsReceived less ItemsMissing less ItemsShipped. And it attempts to do this by taking a count of the unique InventoryID for each selection. So sfrmGiK_Received shows a count([InventoryID]) of 540 and sfrmGiK_Shipped shows a count([InventoryID]) of 240. I'm trying in the footer of frmGiK to show a TEXT box with =Count([sfrmGiK_Received].[InventoryID])-Count([sfrmGiKShipped].[InventoryID]).

    Sorry for the obfuscation, and I hope this makes it clear.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Totals (2003)

    You could put a text box txtReceived on sfrmGiK_Received with control source
    <code>
    =Count([InventoryID])
    </code>
    and a similar one called txtShipped on the other subform. These text boxes can be hidden if you prefer. You can then use
    <code>
    =[sfrmGiK_Received]![txtReceived]-[sfrmGiK_Shipped]![txtShipped]
    </code>
    as control source of your text box on the main form.

  5. #5
    New Lounger
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you

    I appreciate it.

Posting Permissions

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