• Query Form (2000)

    Author
    Topic
    #417140

    (While anyone can help me with this, Hans, you offered me a solution a couple of months ago- I should have taken it!)

    I would like to develop a form that captures criteria from the user to be used to run a query (that would either be displayed in a bound subform or in a new form- doesn’t matter).

    For example, the user selects firm size (combo/list box), age of firm (combo/list box), and three other Yes/No check boxes. Upon completing this selection process, (perhaps an “update” control button is clicked) a query is generated based on these criteria and ran, with the results displayed in the subform or in a new form.

    (I know how to control a form from one combo/list box, but I can’t extrapolate this knowledge to a multi-field query.)

    Any example will help.

    Thanks,

    Brandon.

    Viewing 1 reply thread
    Author
    Replies
    • #935135

      The secret lies not in the design of the form, but the design of the query. If you’re designing the query in design view, you can set the values in the Criteria row to the values of the fields on your form, like this:

      [Forms]![MyFormName]![FirmSizeComboBox]

      As long as the query runs while the form is open, it should work. If the form isn’t open, the user will be prompted to enter the parameter values for each of the criteria.

    • #935138

      If you have access to the Northwind Sample Database, have a look at the Sales by Year Query and the Sales by Year Dialog Form. It will give you a workable example of how to take advantage of this feature!

      • #935144

        Dave and Rudi,

        Thanks to both of you for your help (I would like to think that I can get it from here, but you never know!)

        Brandon.

    Viewing 1 reply thread
    Reply To: Query Form (2000)

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

    Your information: