ACC: Using Find Command in a Query Causes Error (158926)
The information in this article applies to:
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q158926
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the Find dialog box to search for a value in a query, you may
receive the following error message.
In Microsoft Access 97
MSACCESS caused a stack fault in module MSJET35.DLL
In Microsoft Access 7.0
MSACCESS caused a stack fault in module MSJT3032.DLL
In Microsoft Access 2.0
MSACCESS caused a General Protection Fault in module MSACCESS.EXE
Note that this error only occurs when you display unique values in your
query result, and the field you are searching with Find is sorted in
Ascending order.
RESOLUTION
To work around the problem, create a form based on the query and use other
methods to search for specific records on your form.
The following example uses the sample database Northwind.mdb (or NWIND.MDB
in version 2.0) to demonstrate a method to find a record using a combo box
on a form:
- Open the sample database Northwind.mdb (or NWIND.MDB in version 2.0).
- Create the following new query called EmployeeZip based on the
Employees table:
Query: EmployeeZip
-------------------------------------------------
Type: Select Query
Field: Region
Table: Employees
Field: PostalCode (or Postal Code in version 2.0)
Table: Employees
Sort: Ascending
- On the View menu, click Properties. If the Field List Properties
dialog box appears, click in an empty space in the upper half of the
query design window to view the Query Properties dialog box.
- Set the Unique Values property of the query to Yes.
- Save the query and close it.
- Create the following new macro called FindZip:
Macro Name Action
-----------------------------
FindZip GoToControl
FindRecord
Locate Product Actions
-------------------------------
GoToControl
Control Name: PostalCode
FindRecord
Find What: =[FindPostalCode]
Find First: Yes
- Create the following new form in Design view called FindEmployeeZip:
Form: FindEmployeeZip
-----------------------------------
RecordSource: EmployeeZip
Caption: Find Employee Postal Codes
DefaultView: Single Form
Text Box
Name: Region
ControlSource: Region
Text Box
Name: PostalCode
ControlSource: PostalCode (or Postal Code in version 2.0)
Combo Box
Name: FindPostalCode
RowSource: EmployeeZip
ColumnCount: 2
ColumnWidths: 0";1"
BoundColumn: 2
AfterUpdate: FindZip
- View the FindEmployeeZip form in Form view. Note that when you select a
zip code in the combo box, the record with that zip code becomes the
current record on the form.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 2.0, 7.0
and 97.
This problem no longer occurs in Microsoft Access 2000.
Modification Type: | Major | Last Reviewed: | 5/9/2003 |
---|
Keywords: | kbbug kberrmsg KB158926 |
---|
|