473,395 Members | 1,629 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,395 software developers and data experts.

Multiple Criteria Parameter Query

I'm trying to set up a parameter query based on an unbound form. This
search form has about 5 text boxes where the user can type in values
within each box and search a specific table based on the values of
those 5 text boxes. One of two of these boxes are based on date. The
obvious part (being the novice that I am) I'm stuck on is having the
query search based on 1 to 5 search values? In other words, I need the
query to search based on as little as 1 and as much as 5 different
search values from the search form.

I've tried using the "Like" operator(?) but I'm using "Between" as a
criteria for the date field and not quite sure if it's possible to use
a "Like" operator(?) with Between.

How can I get the query to work in cases where the user is not
searching based on all 5 search values.

Thank you for any help you can give me!!
dskillingstad

Nov 13 '05 #1
2 4732
<ds***********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I'm trying to set up a parameter query based on an unbound form. This
search form has about 5 text boxes where the user can type in values
within each box and search a specific table based on the values of
those 5 text boxes. One of two of these boxes are based on date. The
obvious part (being the novice that I am) I'm stuck on is having the
query search based on 1 to 5 search values? In other words, I need the
query to search based on as little as 1 and as much as 5 different
search values from the search form.

I've tried using the "Like" operator(?) but I'm using "Between" as a
criteria for the date field and not quite sure if it's possible to use
a "Like" operator(?) with Between.

How can I get the query to work in cases where the user is not
searching based on all 5 search values.

Thank you for any help you can give me!!
dskillingstad

In this sort of situation, you are probably not getting any benefit from the
fixed query parameters. I would abandon this approach and instead loop
through the 5 textboxes and build the sql statement up like that. Using DAO
you could then change the SQL property of the querydef object before you
open it. ie you have one query which you constantly re-write each time the
user clicks the search button.
Nov 13 '05 #2
DSKillingstad,
As the other reply says, you have to write some code to look at which text
boxes have values, whether the values supplied are valid, and if so, write a
WHERE clause for your SELECT statement based on the values supplied. One
issue that will come up is whether you arbitrarily decide the logical
operator for each supplied value or whether you will provide a means for the
user to indicate what they wanted. I follow the form given to users in
Excel and my dialog box offers a combo box of plain engilsh descriptions of
boolean operators and an option group to select either "and" or "or". Once
all this is working you won't need a PARAMETER clause in your select
statement because this finished custom form will produce a SELECT statement
that returns a result set based on what the user asked for.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

<ds***********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I'm trying to set up a parameter query based on an unbound form. This
search form has about 5 text boxes where the user can type in values
within each box and search a specific table based on the values of
those 5 text boxes. One of two of these boxes are based on date. The
obvious part (being the novice that I am) I'm stuck on is having the
query search based on 1 to 5 search values? In other words, I need the
query to search based on as little as 1 and as much as 5 different
search values from the search form.

I've tried using the "Like" operator(?) but I'm using "Between" as a
criteria for the date field and not quite sure if it's possible to use
a "Like" operator(?) with Between.

How can I get the query to work in cases where the user is not
searching based on all 5 search values.

Thank you for any help you can give me!!
dskillingstad

Nov 13 '05 #3

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

Similar topics

0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
4
by: carl.barrett | last post by:
Hi, I have a list box that displays 2 columns. Behind it sits a query with five columns. These are Column1 (DOB), column2 (a concatenated string of Surname Forname, Title), Column3 (Surname),...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
2
by: angie | last post by:
I need to figure out how to create a user interface to search a query, but here's the bad part...I need to account for criteria on at least 7 of the fields. Here's what I'm thinking I need to do:...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
17
by: sharsy | last post by:
Hello guys, I would like some help in generating query criteria that will identify credit cards that have expired on an access database. The specific Field is formatted with a Data Type of...
1
by: HSXWillH | last post by:
I have looked for some help on this and this article/thread was as close to what I was looking for as I could find. http://bytes.com/forum/thread603918-Null+Parameter+Query.html My only...
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?
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.