• Drop-down list of options for running a query (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Drop-down list of options for running a query (Access 2000)

    Author
    Topic
    #386834

    Hi All,

    I am trying to formalize a query function in which a user, upon clicking a Switchboard button to run a query, will be prompted for the data to query on within a drop-down list (combo box), rather than the default blank textbox. In other words, I want a list of results for a particular customer, but I am not sure how the customer name was entered. If there is a list to choose from, then I can be sure to get the exact match in order to run the query.

    At present, I merely use the criteria: [Enter Customer Name] and Access then displays an empty textbox prompt with the title “Enter customer Name”, but I want that to be a combo box containing the limited options available (perhaps based on a SELECT DISTINCT query of the customer name field in the database table).

    Thanks for any help I can get!

    Drew Shelley

    Viewing 0 reply threads
    Author
    Replies
    • #672741

      To do that, you have to create an unbound form with a combo box, an OK button and a Cancel button. The Switchboard button should open this form instead of the query.
      The Row Source of the combo box should be the customer table or a query based on it. You can use the Combo Box Wizard to create the combo box. The List Only property of the combo box should be set to Yes, so that the user can only select existing names.
      The On Click event procedure of the OK button should open the query (or better, a form or report based on the query).
      The query parameter should refer to the combo box. Say that your form is named frmSelect, and the combo box is named cbxCustomer. Replace the parameter [Enter Customer Name] by [Forms]![frmSelect]![cbxCustomer].
      Post back if you need more assistance.

    Viewing 0 reply threads
    Reply To: Drop-down list of options for running a query (Access 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: