473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Query Parameter drop down box???

Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box?
And whether it is possible?

Kind regards,

Cassandra
Nov 12 '05 #1
3 36295
no bother at all !!

With your form in design view make sure the wizard is turned on and select combo
box from the tool bar.
The wizard will guide you through the set up
In your query criteria put something like --
[Forms]![yourformname]![yourcomboname]

The query will look at the first column in the combo some make sure that is
doing what you want

HTH
David B

cassandra.flowers <ca***************@btopenworld.com> wrote in message
news:c5**********@sparta.btinternet.com...
Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box?
And whether it is possible?

Kind regards,

Cassandra


Nov 12 '05 #2
You have to design a form to ask for the parameter and then set the
criteria to the value of combo box on the form.

If the form is called myform and the combo box mycombo then the criteria
(for equality) is:

Forms!myform!mycombo

You use a button on the form to run the query.

Peter Russell

cassandra.flowers previously wrote:
I was wondering if it is possible (Using access) to have a query
parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down
box?
And whether it is possible?


Nov 12 '05 #3
Hi Cassandra,

Not that there is anything at all wrong with the suggestions made by David
and Peter, but I am in the habit now of taking this one step further...

The problems (annoyances, really) with this form / query method are:
1.) It is possible to open the query without having the form open, which
causes a message to be displayed prompting for the form reference parameter.
2.) Assuming that I now have the form open, have specified a parameter, and
have received the desired results in the query. Now I want to specify a
different parameter and see the new results. I have to close the query,
return to the form, specify something else, then re-open the query.

I recall thinking "There's just gotta be a better way!" ... and there is.

What I do now is to use an unbound main form that collects the criteria, and
have the results immediately displayed in a datasheet-style subform on the
same form!
I build an SQL string (the same thing that using a "query" does) using code,
then use that SQL as the recordsource for the subform. Changing the
subform's recorsource forces a requery of the subform, so the results are
nearly instantaneously displayed.

You can also (optionally) open a report based on the same SQL string in
order to get a "hard copy" of the same data that is displayed in the
subform. I call this the "WYSIWYG" (What You See Is What You Get) approach
to reporting.

If you're interested in this method, have a look at one of my recent posts
on this.
http://groups.google.ca/groups?q=Don...lgrps13&rnum=3

Don

"cassandra.flowers" <ca***************@btopenworld.com> wrote in message
news:c5**********@sparta.btinternet.com...
Hi,

I was wondering if it is possible (Using access) to have a query parameter
as a drop down box rather than a text box?

e.g. typing [Enter a name] as criteria for a query produces a box with a
text box for you to enter the parameter.

Can any body enlighten me on how to turn this text box into a drop down box? And whether it is possible?

Kind regards,

Cassandra

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Bo | last post by:
Hi, I have a drop down menu that is being populated by a query to the access database ---- Code --- Skill needed <SELECT size="1" NAME="SkillType" VALUE="SkillType"> <OPTION>...
2
by: Jeff Thur | last post by:
I am running a SQL Stored Procedure that will give the user a count of how many records are in the database as per certain criteria. I'm using the Execute Scalar Method. I have no problem passing...
3
by: cassandra.flowers | last post by:
Hi, I was wondering if it is possible (Using access) to have a query parameter as a drop down box rather than a text box? e.g. typing as criteria for a query produces a box with a text box...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
3
by: tarscher | last post by:
Hi all, I have 2 dropdownlists that after selection feed the WHERE in a sql query SELECT * FROM tbl WHERE a = 'dropdown1' AND b = 'dropdown2' I also want to add the selection to the...
8
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
2
by: ponyeyes | last post by:
Hi There, I am a bit of a newbie to PHP programming and I would like to know how I can place a selected drop down option into a PHP variable and then produce an sql query which incorporates this...
6
by: limperger | last post by:
Hello everyone! This is by no means urgent nor important, but just in case anyone has encountered this problem... Is it possible, in a parameter query (with its default Msgbox prompting to enter...
6
by: Palehorse | last post by:
I'd like to apologize upfront for me saying "I'm not a programer", I'm sure you all hear this a hundred times a day. Unfortunately, in this case, it's true. I've been working on trying to figure out...
24
sueb
by: sueb | last post by:
I want to create a query for my Surgery database that asks for a Start Date and an End Date (easy), but also asks for a Surgeon using a drop-down list. This list already exists (the main database...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.