Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Ontario, Canada
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

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

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

    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.

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Location
    Ontario, Canada
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Thanks Hans. That worked great!

    Drew

Posting Permissions

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