ACC2: GP Fault Using Module.InsertText in Form Module

ID: Q121276


The information in this article applies to:


SYMPTOMS

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

When you use an implicit reference to a module with the InsertText method in a form module, you may receive a general protection (GP) fault.


RESOLUTION

Use an explicit reference to the module when you are using the InsertText method in a form module. The following statement is an example of an explicit reference to a module:


   Forms![FormName].Module.InsertText Field0.Text 


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This behavior no longer occurs in Microsoft Access version 7.0.


MORE INFORMATION

Steps to Reproduce Problem

WARNING: Following the steps in this example will cause a GP fault on your computer. You should save and close any open files on your computer before following these steps.
  1. Start Microsoft Access and open the sample database NWIND.MDB.


  2. Create a blank, new form.


  3. Add a text box with the following property to the form:
    
          Name: Field0 


  4. Set the text box's AfterUpdate property to the following event procedure:
    
          Sub Field0_AfterUpdate()
             Module.InsertText Field0.Text
          End Sub 


  5. View the form in Form view.


  6. Type any text in the text box, and then press ENTER. Note that you receive a GP fault error message.



REFERENCES

For more information about InsertText, search on "InsertText" using the Microsoft Access Help menu.

Additional query words: gpf


Keywords          : kberrmsg kbusage FmsEvnt 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 7, 1999