Microsoft KB Archive/158926

= ACC: Using Find Command in a Query Causes Error =

Article ID: 158926

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



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: <pre class="fixed_text">     Macro Name        Action -     FindZip           GoToControl FindRecord

Locate Product Actions ---     GoToControl Control Name: PostalCode FindRecord Find What: =[FindPostalCode] Find First: Yes </li>  Create the following new form in Design view called FindEmployeeZip: <pre class="fixed_text">     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 </li> 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.</li></ol>

<div class="status_section">

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.

<div class="moreinformation_section">

Steps to Reproduce Problem
WARNING: Following these steps will cause a general protection fault on your computer. Make sure you save and close any open work on your computer before following these steps.
 * 1) Perform steps 1 through 4 in the "Resolution" section of this article.
 * 2) View the query in Datasheet view.
 * 3) Click in the Postal Code column.
 * 4) On the Edit menu, click Find.
 * 5) In the Find In Field dialog box, type 98033 in the Find What box, and then click Find First.
 * 6) Type 98052 in the Find What box, and then click Find Next.
 * 7) Type 98033 in the Find What box, and then click Find Next.
 * 8) Click Find Next again. Note that the error occurs.

Additional query words: MSACCESS caused a stack fault in module msjet35 dll msjt3032 dll exe

Keywords: kbbug kberrmsg KB158926

-

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

© Microsoft Corporation. All rights reserved.