Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    54

    Unanswered: Really Easy Subform Question...

    I feel pretty dumb asking this...

    I have a subform that displays our vendor's item package depending on the machine chosen earlier in the Form.

    I would like to total the amount displayed in the subform, so I can use it in cost analysis.

    Would I use the Control Source of a textbox outside of the subform but on the main form to do this? And what kind of source would I need?

    I have a query, listed below, that will pull it up depending on the DetailID (which is generated in the form...) but I don't know how to factor this query in with my form.

    Thanks!!

    SELECT [Marposs Laser Parts].MarpossLaserPartID, [Marposs Laser Parts].MarpossPartNum, [Marposs Laser Parts].MarpossPartDescription, [Marposs Laser Parts].MarpossPartCost, [Marposs Laser Parts].ModelID, MachineDetail.DetailID
    FROM [Marposs Laser Parts], MachineDetail
    WHERE ((([Marposs Laser Parts].ModelID)=[MachineDetail].[ModelID]) AND ((MachineDetail.DetailID)=[Purchase Info].[DetailID]));

  2. #2
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313

    an easy way...

    An easy way to do this is to make a footer in the subform and do totals there.

    You would create a textbox (must be in the footer) and do something like:

    =Sum([MarpossPartCost])

    HTH.

  3. #3
    Join Date
    Aug 2004
    Posts
    54

    Nope...

    I tried to do that, but it really didn't work in Datasheet view, and in Single Form view the footer textbox appeared, but it did so repeatedly with each item, and I couldn't sum.

    I think it's just evil.

    Any ideas would be great.

    Thanks!

  4. #4
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313
    Aah, the sum will only work with a subform in continuous form (sorry for the assumption). I wouldn't make a moral judgement on it just yet, although you're probably right about being evil.

    If you're stuck with datasheet/single form, you could create another subform to display the totals. Just create a totals query that groups by MachineID and sums MarpossPartCost.

    Let me know if you need further help with that.

    HTH,

    Chris

Posting Permissions

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