ACC2000: Prompted Again for Parameter on Refresh of Client-Server Query
ID: Q202199
|
The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
SYMPTOMS
If you refresh a parameter query in a Microsoft Access database, you are not prompted again for the parameter. However, if you refresh a parameter query in a Microsoft Access project, you do receive another prompt for the parameter.
MORE INFORMATION
Steps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- Create a new query in Design view and add the Orders table.
- Drag the OrderDate field to the QBE grid and set Sort to Ascending.
- Enter the following criteria in the OrderDate column:
Between [Start Date] And [End Date]
NOTE: You must define the data type of both [Start Date] and [End Date]. To do so, click Parameters on the Query menu.
- Click Run on the Query menu and enter the following values when prompted for the Start Date and End Date:
08/01/96
08/31/96
Note that you receive a list of the orders for August 1996.
- Press SHIFT+F9 to refresh. Note that you are not prompted for the parameter again.
- Close the Northwind database.
- Open a Microsoft Access project based on a Microsoft SQL Server database.
- On the File menu, point to Get External Data, and then click Import.
- In the Import dialog box, browse to the Northwind database, select it, and click Import.
- In the Database window, click Tables under Objects, select the Orders table, and then click OK. The Orders table is imported into your project.
- In the Database window, click Stored Procedures under Objects, and then click New.
- In the new stored prodedure window, delete all the existing text and type the following:
Create Procedure ParameterTest
(
@startdate datetime,
@enddate datetime
)
As
SELECT IDENTITYCOL, CustomerID, EmployeeID, OrderDate
FROM Orders
WHERE (OrderDate BETWEEN @startdate and @enddate)
return
- Save the new ParameterTest procedure and close it.
- In the Database window, click Stored Procedures under Objects, double-click ParameterTest, and then enter the following values when prompted for the start date and end date:
08/01/96
08/31/96
Note that you receive a list of the orders for August 1996.
- Press Shift+F9 to refresh.
Note that you are asked for the start and end dates again.
Additional query words:
Input prb
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 13, 1999