ACC2: "Fill Specification Grid from Table" Causes Fatal Error

Last reviewed: June 3, 1997
Article ID: Q153467
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

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

When you click the "Fill Specification Grid from Table" button when you are exporting a fixed-width text file using the DoMenuItem action, you may receive the following error message:

   An Error has occurred in your program. To quit this program click Close.
   You will lose information entered since your last Save.

CAUSE

The Database window did not have the focus when the DoMenuItem action was carried out.

RESOLUTION

Before issuing the DoMenuItem command that starts the export process, set the focus to the Database window. The following example demonstrates how to use a SelectObject macro action to set the focus to the Database window:

   Macro Action
   ---------------------------
   SelectObject
      Object Type: Macro
      Object Name: Autoexec
      In Database Window: Yes

Be sure that the Object Type and Object Name refer to an existing object in your database. The In Database Window argument must be set to Yes.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database NWIND.MDB.

  2. Create the following new macro:

          Macro Name    Macro Action
          --------------------------
          TestExport    DoMenuItem
    
          TestExport Actions
          ---------------------
             Menu Bar: Database
             Menu Name: File
             Command: Export
    
    

  3. Create a new blank form called TestExport. Add a command button to the form and set the OnClick property to the TestExport macro.

  4. View the TestExport form in Form view and click the command button to run the TestExport Macro.

  5. In the Export dialog box, select Text (Fixed Width), and then click OK.

  6. In the "Select Microsoft Access Object" dialog box, select the Customers Table, and then click OK.

  7. In the Export To File dialog box, click OK.

  8. In the Export Text Options dialog box, click the Edit Specs button, and then click the "Fill Specification Grid from Table" button. Note that you receive the error message described in the "Symptoms" section.


Additional query words: GPF ADT fixed-width export
Keywords : IntpOthr IsmTxtfx kbinterop
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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: June 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.