prompted twice for parameters when running query

G

Guest

I have created a select query with date range parameters. When I run the
query I am prompted to enter start-date and end-date - but am then prompted
again. I enter the dates again and the query functions as expected, but I
can't work out why I should be prompted twice. Any ideas?
 
G

Guest

Hi Dom

This can happen when a query is filtered or sorted when viewing the results
and saved when closed.

Go to the SQL view of your query and copy the contents
Create a completely new query, don't add any tables - go to SQL view and
paste the SQL just copied
If this now works - delete the old query and save this one

hth

Andy Hull
 
J

John Spencer

1) Variations on the name - if you've declared the parameters as [Enter
Start Date ] and then referred to them as [Enter Start Date] (note the space
at the end of the first) then you will be prompted for both and only the
referred value will actually be used.

2) You've applied a filter or sort to the query in datasheet view and saved
the change. This can sometimes cause the query to run twice. Once for the
acutual SQL and a second time to apply the filter or sort If this is the
case open the query in datasheet view and Select Remove Filter/Sort and save
the query.

If that doesn't solve the problem, post your SQL and perhaps someone can
spot the problem.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Hi Andy, John.

I pasted the SQL into a new query and this did the job.

Cheers,
Dom
 

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