Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: AutoCorrect Triggers Change Event


View products that this article applies to.

Symptoms

When you use the AutoCorrect feature in Microsoft Access to correct typing errors automatically, the Change event of a control on a form is triggered each time that AutoCorrect is invoked. This can cause undesirable results, such as error messages or continuous looping of the automatic correction.

↑ Back to the top


Resolution

You can disable AutoCorrect for a text box or a combo box on a form by setting the control's AllowAutoCorrect property to No. You may want to do this for any text box or combo box on your form that has an event procedure or a macro attached to its Change event.

If you want to disable all or portions of the AutoCorrect feature, click AutoCorrect on the Tools menu, and change the options in the AutoCorrect dialog box.

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. Start Microsoft Access and open any database.
  2. Verify that the AutoCorrect feature is turned on by clicking AutoCorrect on the Tools menu. Verify that the Replace text as you type option is selected and that lowercase letter "i" is in the Replace list.
  3. Create the following new form not based on any table or query:
        Form: TestAuto
        -----------------------------
        Text box:
           Name: Text0
           OnChange: [Event Procedure]
        Text box:
           Name: Text2
    					
  4. Set the OnChange property of the Text0 text box to the following event procedure:
     Private Sub Text0_Change
       Me!Text2.SetFocus
     End Sub
    					
  5. Switch the form to Form view.
  6. Type a lowercase letter i in the Text0 text box. Note that you receive the following error message:
    Run-time error '2110'
    Microsoft Access can't move the focus to the control Text2.

↑ Back to the top


References

For more information about the AutoCorrect feature, click Microsoft Access Help on the Help menu, type Work with AutoCorrection in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

↑ Back to the top


Keywords: KB198932, kbprb

↑ Back to the top

Article Info
Article ID : 198932
Revision : 2
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 247