• Value filled by query (2003)

    Author
    Topic
    #455280

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1132567

      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.

      • #1132570

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

        Take Care,
        Mark

    Viewing 0 reply threads
    Reply To: Value filled by query (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: