Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Value filled by query (2003)

    Hi All,
    I have an unbound control on a form. On the form is also a sub-form with various items shown in datasheet view. I want the control in question to show the sub-total of all the items in the sub-form (monetary value). I have a query written now that displays the total value when I run it but I am at a loss as to how to make that value be displayed in the control.

    Thanks,
    Mark

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

    Re: Value filled by query (2003)

    Place a text box in the footer of the subform with control source =Sum([NameOfField]) substituting the name of the field whose values you want to add. Name this text box txtTotal. You can hide it if you wish by setting its Visible property to No.

    Set the control source of the text box on the main form to

    =NameOfSubform!txtTotal

    where NameOfSubform is 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
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Value filled by query (2003)

    Thanks Hans,
    I have to remember that there are some example DBs with this stuff (Northwind for example!).

    Take Care,
    Mark

Posting Permissions

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