The On Change event fires are you type in the control. Not useful for spell checking.
The On Exit event fires whenever you leave the control. Even if the control has not been change. Not very useful for spell checking as it would also fire off even if no value was entered into the control or nothing was changed.
Because you are using the above two event, you are having to write a lot more code than needed.
You should also check to be sure that the control has a value before trying to run the spell check.
The ideal event is the After Update event. It will only fire when you exit the control if the value in the control has changed. That is exactly when we need to spell check.
Example code to Spell Check using the After Update event of a control named Notes:
Code:
Private Sub Notes_AfterUpdate()
DoCmd.SetWarnings False
With Me![Notes]
' make sure that there is something to spell check
If Len(.Value) > 0 Then
' select the text in the control
.SetFocus
.SelStart = 1
.SelLength = Len(.Value)
' run the spell check
DoCmd.RunCommand acCmdSpelling
' unselect the text
.SelLength = 0
End If
End With
DoCmd.SetWarnings True
End Sub