A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Drop down list search



 
 
Thread Tools Display Modes
  #1  
Old February 28th, 2007, 02:10 PM posted to microsoft.public.access.queries
Matt Dawson
external usenet poster
 
Posts: 169
Default Drop down list search

I currently have a query which run from 3 parameters in order to select
fields which are based on three criteria.
However, some users do not know the list to choose from and therefore i
think it would be far easier if there was some form of drop down list box to
select the option they require.
Is there any way of doing a drop down parameter or would I need to create a
form with the drop downs and then link this? If so, how would I?
Many Thanks,
Matt
  #2  
Old February 28th, 2007, 04:27 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Drop down list search

Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm

Or check out this from MS
http://office.microsoft.com/en-us/ac...730581033.aspx

A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries, cascading comboboxes

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Matt Dawson" wrote in message
...
I currently have a query which run from 3 parameters in order to select
fields which are based on three criteria.
However, some users do not know the list to choose from and therefore i
think it would be far easier if there was some form of drop down list box
to
select the option they require.
Is there any way of doing a drop down parameter or would I need to create
a
form with the drop downs and then link this? If so, how would I?
Many Thanks,
Matt



  #3  
Old February 28th, 2007, 05:22 PM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default Drop down list search

On Wed, 28 Feb 2007 06:10:31 -0800, Matt Dawson wrote:

I currently have a query which run from 3 parameters in order to select
fields which are based on three criteria.
However, some users do not know the list to choose from and therefore i
think it would be far easier if there was some form of drop down list box to
select the option they require.
Is there any way of doing a drop down parameter or would I need to create a
form with the drop downs and then link this? If so, how would I?
Many Thanks,
Matt


If the query is the end result you can use this.
If however, the query is used as the record source for a report, the
procedure is a bit different. Post back.

You'll need to use a form to do this.

Make a new unbound form.
Add a combo box that will show the CircuitID field.
Make sure the Combo Box Bound Column is the same DataType as the
CircuitID field.
Add a command button.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"

Code the Query CircuitID field criteria line:

forms!ParamForm!ComboBoxName

When you wish to run the query, open the form first.
Find the CircuitID in the combo box.
Click the command button.

The query will display just those records selected.
The Form will close.

Change [CircuitID] to whatever the actual field name is.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.