Microsoft KB Archive/202199

= ACC2000: Prompted Again for Parameter on Refresh of Client-Server Query =

Article ID: 202199

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q202199



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to 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.



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.</li> Close the Northwind database.</li> Open a Microsoft Access project based on a Microsoft SQL Server database.</li> On the File menu, point to Get External Data, and then click Import.</li> In the Import dialog box, browse to the Northwind database, select it, and click Import.</li> In the Database window, click Tables under Objects, select the Orders table, and then click OK. The Orders table is imported into your project.</li> In the Database window, click Stored Procedures under Objects, and then click New.</li>  In the new stored prodedure window, delete all the existing text and type the following: <pre class="fixed_text">  Create Procedure ParameterTest

(        @startdate datetime,         @enddate datetime      )

As  SELECT IDENTITYCOL, CustomerID, EmployeeID, OrderDate FROM Orders WHERE (OrderDate BETWEEN @startdate and @enddate)

return </li> Save the new ParameterTest procedure and close it.</li> 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.</li> Press Shift+F9 to refresh.

Note that you are asked for the start and end dates again.</li></ol>

Additional query words: Input prb

Keywords: kbprb KB202199

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.