If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Query Question - How to query only items listed in a dropdown box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-12, 11:55
Maxx102 Maxx102 is offline
Registered User
 
Join Date: Jan 2012
Posts: 6
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?
Reply With Quote
  #2 (permalink)  
Old 01-13-12, 12:03
kez1304 kez1304 is offline
Registered User
 
Join Date: Jun 2011
Location: Inside your mind
Posts: 267
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:

Code:
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...
Reply With Quote
  #3 (permalink)  
Old 01-13-12, 12:15
Maxx102 Maxx102 is offline
Registered User
 
Join Date: Jan 2012
Posts: 6
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.
Reply With Quote
  #4 (permalink)  
Old 01-13-12, 12:50
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On