Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Location
    Carol Stream, Illinois, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sums for inventory (XP)

    Me again. I'm almost there with my inventory tracking db, but I'm hung up on one thing. I have a "products" form with a "transactions" subform. The subform works fine and I can list each transaction for any particular product. However, I want to have a summed quantity total on the main form, and so far I can only get it to show the numerical value of whatever transaction my cursor is on in the subform. I want to be able to use positive and negative numbers to perform the transaction changes, and have the entire column summed in the totals field. ??? Thanks. Oh, here's the code from the totals field: =[Products Subform].[Form]![Bang] (Bang is the name of the inventory column in my transactions subform.)

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

    Re: Sums for inventory (XP)

    Try putting a text box in the report footer section of the subreport, with control source

    =Sum([Bang])

    Name this text box txtSum; if you like, you can set its Visible property to No. On the main form, put a text box with control source

    =[Products Subform]![txtSum]

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Location
    Carol Stream, Illinois, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sums for inventory (XP)

    Thanks for the reply. When you say "report footer section of the subreport", does that mean the same thing as subform? I tried that, and still get a #Error in the Bang totals field.

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

    Re: Sums for inventory (XP)

    Sorry, I meant subform, not subreport.

    In the expression =[Products Subform]![txtSum], you must 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. To see the control name, open the main form in design view and click once on the subform. Don't click a second time, for then you will select something in the subform. If you have accidentally clicked twice, click outside the subform, then once on the subform. The control name will be displayed in:
    - The Control dropdown in the Formatting (Form/Report) toolbar
    - The caption of the Properties window.

  5. #5
    New Lounger
    Join Date
    Oct 2002
    Location
    Carol Stream, Illinois, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sums for inventory (XP)

    In this case - the name is the same. Actually, I just got it. I'm not sure what the difference was, but I used the expression builder, and it did this: =[Products Subform].[Form]![txtSum] That worked. Thanks for all your help.

Posting Permissions

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