473,378 Members | 1,457 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,378 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 36292
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.