ACC: Using Find Command in a Query Causes Error

Last reviewed: May 14, 1997
Article ID: Q158926
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

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

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:

  1. Open the sample database Northwind.mdb (or NWIND.MDB in version 2.0).

  2. 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
    
    

  3. 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.

  4. Set the Unique Values property of the query to Yes.

  5. Save the query and close it.

  6. 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
    
    

  7. 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
    
    

  8. 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. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

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-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.


Keywords : kberrmsg kbusage QryGnrl
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.