Spell Check and Focus

J

JKro

I have a form that is loaded with multiple records via the ApplyFilter
action. Users can move through these records by using the navigation records
at the bottom of the form. I also have a text box on the form that I want to
perform a spell check on everytime its text is added/edited. Everything
works great when edit this text box and then go to another field on the form
or when I close out of the form. The problem occurs when I edit the text box
then immediately click the navigation button for the next record. The spell
check for the text field runs fine but my form does not advance to the next
record. I suspect this is because, when the spell check runs, the text box
gets updated thus moving focus to that field and the action of going to the
Next Record gets lost. My code is as follows:

Private Sub txtBox_LostFocus()

' Spell Check
DoCmd.SetWarnings False
If Len(ttxtBox) > 0 Then
txtBox.SelStart = 0
txtBox.SelLength = Len(txtBox)
DoCmd.RunCommand acCmdSpelling
End If
DoCmd.SetWarnings True

End Sub

I've been banging my head against the wall regarding this for days. If
someone could help me out I would greatly appreciate it. Thanks!

JKro
 
Top