Prompt to Select Query to Run

T

Takeadoe

I've found the following posts to be helpful, but I'm trying to
accomplish something just a bit different.

http://groups.google.com/group/micr...=drop+down+menu&rnum=1&hl=en#123feb83a5e0cecc


http://groups.google.com/group/micr...=drop+down+menu&rnum=2&hl=en#5ca3b882d6977332

Let's say that I have 3 different "parameter" queries - date of birth,
last name, and driver's license. To reduce clutter and simplify things
for the end user, I would like to hide the queries and limit the user
interface to a single form (or query) that would prompt the user for
the name of the query (LN, DL, DOB) that would then in turn bring up
the appropriate parameter box for the selected query. Am I nuts, or is
something like this possible? I have big ideas, but little Access
experience!

Thanks.

Mike
 
D

Douglas J. Steele

Rather than have the queries prompt for their parameters, have text boxes
(or even combo boxes) on your form, and have the queries refer to those
controls. Presumably you've got something like [Date Of Birth] as a
parameter in your query. If you've got a text box named txtDOB on your form
(let's call it frmQueryLaunch), you'd replace that [Date Of Birth] parameter
with Forms!frmQueryLaunch!txtDOB in your query.

Have a combo box on the form that lists the queries, and a command button
that launches the selected query once the necessary values have been
supplied in the text boxes (or combo boxes if you go that way).
 
J

John Vinson

Let's say that I have 3 different "parameter" queries - date of birth,
last name, and driver's license. To reduce clutter and simplify things
for the end user, I would like to hide the queries and limit the user
interface to a single form (or query) that would prompt the user for
the name of the query (LN, DL, DOB) that would then in turn bring up
the appropriate parameter box for the selected query. Am I nuts, or is
something like this possible? I have big ideas, but little Access
experience!

If the only difference between the queries is in which field you're
searching, I'd really suggest using just ONE query; follow Douglas'
suggestion of using a Form to collect the criterion (or criteria!),
but use OR logic so that it will check all three form controls (or any
combination of one or more of them). You can use

=[Forms]![frmQueryLaunch]![txtDOB] OR
[Forms]![frmQueryLaunch]![txtDOB] IS NULL

as a criterion for DOB, and similar criteria on DL and LN; just put
the three criteria on separate lines of the query grid.


John W. Vinson[MVP]
 
T

Takeadoe

A very sincere thank you to both John and Doug for their help on this.
I will make great use of this.

Mike


John said:
Let's say that I have 3 different "parameter" queries - date of birth,
last name, and driver's license. To reduce clutter and simplify things
for the end user, I would like to hide the queries and limit the user
interface to a single form (or query) that would prompt the user for
the name of the query (LN, DL, DOB) that would then in turn bring up
the appropriate parameter box for the selected query. Am I nuts, or is
something like this possible? I have big ideas, but little Access
experience!

If the only difference between the queries is in which field you're
searching, I'd really suggest using just ONE query; follow Douglas'
suggestion of using a Form to collect the criterion (or criteria!),
but use OR logic so that it will check all three form controls (or any
combination of one or more of them). You can use

=[Forms]![frmQueryLaunch]![txtDOB] OR
[Forms]![frmQueryLaunch]![txtDOB] IS NULL

as a criterion for DOB, and similar criteria on DL and LN; just put
the three criteria on separate lines of the query grid.


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top