Different Parameters for single query

  • Thread starter Thread starter GR
  • Start date Start date
G

GR

hi,
I have a query based in one table. I want to let the user
specify different parameters for the query. how can I
change the query parameters during run time?
 
Check Access HELP on "parameter query". You can prompt the user for input
of the parameter(s) when the query runs.

If you have a lot, consider creating a form that the user uses to select
parameters, and have your query refer to that form's controls for its
criteria.

Good luck

Jeff Boyce
<Access MVP>
 
I don't have many parameters for a single query, my
problem is having different parameters for one single
query. The only solution is having different queries for
each parameter?
 
GR

Look up "parameter query" in Access HELP -- you can use a single query, with
a "parameter" prompt.

Good luck

Jeff Boyce
<Access MVP>
 
I know I can use a parameter prompt, but with this prompt
the user will give for example to view all offers for a
begining date or ending date.
I have a table with offers, dates, costs, etc.
I want to know if it's possible to have different
parameters, or different prompts (sorry I now my english
sucks)
For example running the same query User A want to see all
offers, user b wants to see all offers for June, user C
wants to see all offers with a cost higher than 10000,
user D wants to see all the info for offerX. if i use
several parameters (one for the bigining date, one for the
cost, etc) I will have several prompts for all the users,
no matter if not their prompt.
is there a way i specify parameters at run time in order
to have the query (without parameters) and depending on
user desires add a parameter clause to the sql string?
 
GR

I now understand (I think) that you want to have a variety of potential
prompts, none of them mandatory. If so, this is not done in a query.

Instead, you can create a "search" form that includes the fields you wish to
search on. Add a command button that:
creates a SQL statement (a query) on-the-fly, based on the values in the form
runs the SQL/query.

Another approach, if your users are reasonably sophisticated Access users,
is to use "query-by-form". This is one of the Toolbar buttons on the forms
menu.

Good luck

Jeff Boyce
<Access MVP>
 
Thx jeff =)
-----Original Message-----
GR

I now understand (I think) that you want to have a variety of potential
prompts, none of them mandatory. If so, this is not done in a query.

Instead, you can create a "search" form that includes the fields you wish to
search on. Add a command button that: on the values in the
form

Another approach, if your users are reasonably sophisticated Access users,
is to use "query-by-form". This is one of the Toolbar buttons on the forms
menu.

Good luck

Jeff Boyce
<Access MVP>

.
 
I have basically the same problem. I have one query based
on the region, but from the results of the [REGIONS]
queried, I would like to generate additonal results within
the form using commands buttons to search for Department
Name, or the City, or the User Last Name, etc. based on
this one query of [REGIONS].
 
Back
Top