Enable spell checking on MS Access from using VBA

Spell Checker on after update event of textbox

This article is about to enable spell checker functionality on update event of Memo field. The spell checker option mostly used in those databases where comments are added frequently. For that spell checker options become key feature. For implement the spell checker we are using VBA code on after update event of memo field. Whenever the spelling error happens the spell checker automatically detect the error when we are saving the text.

To implement spell checker firstly we have to create a table and form with text filed. Bind this form with table and textbox with its text field as shown in Fig 1.1.

Spell Checker on MS Access Form using VBA. Fig-1.1

Fig-1.1

Now we have to implement spell checker on after update event of textbox. After implementation we have to test spell checker. As we save misspelling text the spell checker automatically detect the error and provide the suggestions to correct it as shown in Fig 1.2.

Spell Checker on MS Access Form using VBA. Fig-1.2

Fig-1.2

As we check the on ok button the spelling is change to correct one as shown in Fig 1.3.

Spell Checker on MS Access Form using VBA. Fig-1.3

Fig-1.3

VBA code

Option Compare Database Private Sub txtTest_AfterUpdate()
If Len(Me!txtTest & "") > 0 Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
Else
Exit Sub
End If
End Sub


DISCLAIMER

It is advised that the information provided in the article should not be used for any kind formal or production programming purposes as content of the article may not be complete or well tested. Access Guru will not be responsible for any kind of damage (monetary, time, personal or any other type) which may take place because of the usage of the content in the article.