Why doe the Parameter dialogue box open twice?

David Ball

Registered User.
Local time
Tomorrow, 07:17
Joined
Aug 9, 2010
Messages
230
Hi,

I have a Command Button on a Form that opens a query. When the button is selected an “Enter Parameter Value” dialog box appears and the user types in a value and presses OK.
This works but it always displays the “Enter Parameter Value” dialogue box twice. I have to enter the value I want the first time, press Enter, then the box appears again and I enter the value I want to search by again. It then runs the query with no problems.
Also, If I press Cancel on the dialogue box I get a “Macro Single Step” window appear that shows an Error Number 2001?
In the Criteria row of the Query I have [Enter KPI Number], nothing else, so I am not sure what is causing the dialogue box to open twice.
Any idea why the Parameter dialogue box would be appearing twice?

Thanks very much
Dave
 
Possible causes are a Filter or Sort on the Form or an Order By in the query.
 
Possible causes are a Filter or Sort on the Form or an Order By in the query.
... or you are using fieldnames in your query that do not exist in the selected tables. Access thinks it is a query parameter.

If you saved the query you can view the parameters of a query (Query1) in your immediate window like this:

?currentdb.QueryDefs("Query1").Parameters(0).Name

if there is more than one, change the 0 into 1 etc.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom