ACC: Parameter Query Returns No Records with Replication ID Field (169955)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q169955 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you run a query based on a table that contains an AutoNumber field,
and the field size of the AutoNumber field is set to Replication ID, no
records are returned.
CAUSE
The query is using an implicit parameter for criteria on the AutoNumber
field, and the AutoNumber field is not indexed.
RESOLUTION
There are two methods to work around this problem. You can create an index
on the AutoNumber field in the table, or you can explicitly define the
parameter within the query.
Method 1 - Creating an Index on the AutoNumber Field- Open the table in Design view.
- Click in the row containing the AutoNumber field.
- Under Field Properties, click the General tab.
- Set the Indexed property of the AutoNumber field to either "Yes
(Duplicates OK)" or "Yes (No Duplicates)".
- Save the table and close it.
Method 2 - Explicitly Defining the Parameter- Open the query in Design view.
- On the Query menu, click Parameters.
- In the Query Parameters dialog box, type the name of the parameter in
the Parameter column, and then select Replication ID in the Data Type
column. For example, if the parameter that the query is expecting is
[Forms]![Form1]![Field1], then the Query Parameters dialog box should
appear as follows:
Parameter Data Type
------------------------ --------------
[Forms]![Form1]![Field1] Replication ID
- Click OK to close the Query Parameters dialog box.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 7.0 and
97.
REFERENCES
For more information about Replication ID AutoNumbers, search the
Help Index for "Replication IDs, AutoNumber fields" and then select
"AutoNumber fields and replication."
Modification Type: | Minor | Last Reviewed: | 1/26/2005 |
---|
Keywords: | kbbug KB169955 |
---|
|