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

ID: Q153467

The information in this article applies to:

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          : kbinterop IsmTxtfx 
Version           : 2.0
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb

Last Reviewed: June 4, 1997