Re: Help creating a query
- From: "Larry Linson" <bouncer@xxxxxxxxxxxxx>
- Date: Sat, 08 Jul 2006 05:44:19 GMT
I find it much more straighforward to create a "base query" without any
criteria, and then enhance its SQL in VBA code with criteria that I obtain
from the selection Form, using the enhanced SQL in the RecordSource of the
pertinent Form or Report, or in the WhereCondition of a DoCmd.OpenForm or
DoCmd.OpenReport.
An advantage of this approach is that you need do nothing to accomodate
returning all values, for selection criteria not entered on the Form -- you
just do not create selection criteria in the WHERE clause you are building.
Larry Linson
Microsoft Access MVP
"DeanL" <deanpmlonghurst@xxxxxxxxx> wrote in message
news:1152309197.456891.259660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Guys,
I need some help creating a query that is going to take between 1 and
10 parameters. The parameters are entered on a form into text boxes
that may have data or be empty. Is there a way to create a single
query that will take parameters if they are present in the text boxes
and not take parameters if the text box is empty?
The ten fields will need to be searched using "Like" so that the user
can search on part of a text string (all the fields are text).
With my limited knowledge of Access it seems that the only way I can
currently see is to create a single query for EACH version of
selections which would amout to about a 1000 queries (as I said, my
knowledge is somewhat limited in this area.).
Many thanks for any help, Dean...
.
- References:
- Help creating a query
- From: DeanL
- Help creating a query
- Prev by Date: Re: Deleting a table in another MDB
- Next by Date: Re: Create a field for every hour between Time In and Time Out
- Previous by thread: Re: Help creating a query
- Next by thread: Re: Help creating a query
- Index(es):
Relevant Pages
|