To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).
To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base:
245025�
OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)
To temporarily work around this problem, create a form to hold the parameters, and then have the query refer to that form. To see how this works, follow these steps:
-
Open the sample database Northwind.mdb.
-
In the Database window, click Queries, and then click New.
- In the New Query dialog box, click Design, and then click OK.
-
In the Show Table dialog box, click the Orders table, and then click OK.
-
Add the following fields to the query design grid:
Field: OrderID
Table: Orders
Field: CustomerID
Table: Orders
Field: OrderDate
Table: Orders
Criteria: Is Not Null And Between [Forms]![frmOrdersByDate]![StartDate]
And [Forms]![frmOrdersByDate]![EndDate]
-
On the Query menu, click Parameters.
-
Type the following parameters, and select the following data types:
Collapse this tableExpand this table
Parameter | Data type |
---|
[Forms]![frmOrdersByDate]![StartDate] | Date/Time |
[Forms]![frmOrdersByDate]![EndDate] | Date/Time |
-
Save the query as OrdersByDate, and then close it.
-
Create the following new form:
Form: frmOrdersByDate
---------------------
Caption: TestForm
Command button
---------------------
Name: Button0
Caption: Show Records
TextBox
---------------
Name: StartDate
TextBox
------------------------------
Name: EndDate
- Set the OnClick property of the command button to the following event procedure:
Private Sub OK_Click()
DoCmd.OpenQuery "OrdersByDate"
End Sub
-
Save the form as frmOrdersByDate, and then open the form in Form view.
-
For the parameters, enter the following:
StartDate: 1/1/1997
EndDate: 12/31/1997
-
Click the Show Records button. The query results are displayed.
-
On the Records menu, point to Sort, and then click Sort Ascending.
Note that the data is sorted, and that you are not prompted for the parameters again.