Microsoft KB Archive/121276

= ACC2: GP Fault Using Module.InsertText in Form Module =

Article ID: 121276

Article Last Modified on 7/5/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q121276



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



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



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.

 Start Microsoft Access and open the sample database NWIND.MDB. Create a blank, new form.  Add a text box with the following property to the form:

     Name: Field0   Set the text box's AfterUpdate property to the following event procedure:

Sub Field0_AfterUpdate Module.InsertText Field0.Text End Sub </li> View the form in Form view.</li> Type any text in the text box, and then press ENTER. Note that you receive a GP fault error message.</li></ol>

<div class="references_section">