Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012

    Unanswered: Query Question - How to query only items listed in a dropdown box

    Hello everyone,

    I have a query question.

    I have a form that has several drop downs for various types of predetermined data. A drop down for States (Alaska, Arizona, etc), drop down for the days of the week. Because this database is for tracking burglaries, I have a third drop down for method of entry (Emergency Exit - Side, Emergency Exit Whse, Garage, Roof, Main Entry, etc)

    Now each drop down has a corresponding table with that information. So my table that shows all of the selections available for Method of Entry, show up in the drop down on the form.

    For all of my queries I use simple parameter pop-up box and it says something like "Search by State" and you type in the name of the state and every record for that state shows up.

    Instead of the parameter pop-up and you have to type, I would like a pop-up to show only those items that are listed in the table and space on the form.

    Is it possible to do a query to allow someone to select an item and not have to type?

  2. #2
    Join Date
    Jun 2011
    Inside your mind
    When you say 'parameter pop-up', do you mean you have a variable in your query, that isn't specified within the query itself...

    So something like:

    SELECT something
    FROM something
    WHERE state = inputState
    Then the popup asks you to input 'inputState'?

    If so, then as far as I know, you can't alter that popup to contain a dropdown box (at least not easily, and therefore not worth pursuing). You could alter the way in which the report(?) is generated, by adding a button on your form to generate the report, taking into consideration the value currently displayed in the state dropdown box.

    Is that what you're after?
    Looking for the perfect beer...

  3. #3
    Join Date
    Jan 2012
    What I mean by parameter popup is a "Enter Parameter Value" box

    When I run a report by say, date, I click on the button (form control) and it then pops up a box that says "Please Enter Date MM/DD/YYYY" you type in the date you want in the manner shown and it shows all data from the particular day.

    Instead of that "Enter Parameter Value" box, is there a way to just select what is on the dropdown list without having to type anything.

  4. #4
    Join Date
    Mar 2009
    Provided Answers: 15
    In such a case, you can build a dynamic query (see: How to build a dynamic query with values from a search form in Access 2007, in Access 2003, or in Access 2002) or change the SQL property of a DAO.QueryDef object (see: SQL Property).
    Have a nice day!

Posting Permissions

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