Applecore Pages on Microsoft Access

Spell checking a Control in a Form

If you have the full version of Office installed, and want to use the Spell Checker to check that data has been entered correctly rather than using AutoCorrect to force changes, you can use code similar to this in the AfterUpdate event for the Control:

Private Sub txtDescription_AfterUpdate()
    If Len(Me!txtDescription & "") > 0 Then
        With Me!txtDescription
            .SetFocus
            .SelStart = 0
            .SelLength = Len(Me!txtDescription)
        End With
        DoCmd.SetWarnings False
        DoCmd.RunCommand acCmdSpelling
        DoCmd.SetWarnings True
    End If
End Sub

I use DoCmd.SetWarnings so that the user doesn't get a message box popping up saying that the Spelling Check is complete.

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 14:54:28