Repeating Prompts from Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that is requesting a start date, end date, beginning zip3 and
ending zip3. When I run the query I am prompted for each of the four pieces
of data and then it starts over and requests them a second time. Why does it
require me to enter this information twice?
 
NancyP said:
I have a query that is requesting a start date, end date, beginning zip3 and
ending zip3. When I run the query I am prompted for each of the four pieces
of data and then it starts over and requests them a second time. Why does it
require me to enter this information twice?


Depends on what the query looks like.

The most common reason is that you used the paramete twice
in the query, but spelled the prompt string differently.

Another reason would be if the query was based on another
query that used the parameters too.

A better approach is to use a form for users to enter the
values they want to search for. Then the query can refer to
the form controls using parameters like
Forms!formname.controlname
 
Marshall Barton said:
Depends on what the query looks like.

The most common reason is that you used the paramete twice
in the query, but spelled the prompt string differently.

Another reason would be if the query was based on another
query that used the parameters too.

A better approach is to use a form for users to enter the
values they want to search for. Then the query can refer to
the form controls using parameters like
Forms!formname.controlname

The query is pulling from a table and each parameter is only entered once.
One of the parameters - zip3 - is a calculation. Would that cause the query
to request the information to be entered twice?

I've not tried to write forms to pull parameters. Where do I learn more
about that?
 
You made that sound way to complicated. You basically create a Form (Form1)
and save it. Within this Form you create your fields [Start Date] [End Date]
[Beginning Zip3] and [Ending Zip3]. This is where the user would enter the
information instead of in a prompt. Now for the Query that runs in that
background, for the criteria, instead of having [Please enter Start Date],
you would have [Forms]![Form1].[Start Date]. For [End Date],
[Forms]![Form1].[End Date]...and so on. Make sense. This way, you don't get
asked for parameter values at all. Have the Form start up on Database
startup, or if this is just a minor function of the whole database, have the
user open the Form as opposed to the Query.

If you have a Report or even another Form based off this Query, it's still
OK. Just make sure that the user populates the fields in the Form prior to
executing the Query. Hope all's well...Good Luck
 
NancyP said:
The query is pulling from a table and each parameter is only entered once.
One of the parameters - zip3 - is a calculation. Would that cause the query
to request the information to be entered twice?

I've not tried to write forms to pull parameters. Where do I learn more
about that?


I can't tell what might be happening without seeing the
query and the context where you use it. Please Copy/Paste
the query's SQL view into a reply. Also try to explain
where the query is used and what happens if you open the
query directly from the query design window.

As for using a form for the query's parameters, Micah
spelled it out as well as I could.
 
NancyP said:
I have a query that is requesting a start date, end date, beginning zip3 and
ending zip3. When I run the query I am prompted for each of the four pieces
of data and then it starts over and requests them a second time. Why does it
require me to enter this information twice?

Hi Nancy,

Another common reason for "repeating parameter prompts"
that I did not see anyone mention is caused by

applying a "extra sort" when you view the results
of your query in the Query Designer.

Open your query so you see the results,
in top menu select "Records"
and click on "Remove Filter/Sort"

Does that help?

Gary Walter
 
Back
Top