Hi All,
I am using the following code (thanks ICEZEBRA) to spell check certain fields upon exit.
Private Sub YOURFIELDNAME_Exit(Cancel As Integer)
Dim strSpell
strSpell = YOURFIELDNAME
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With YOURFIELDNAME
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub
This works great on the main form. However, when I try it on any of the sub-forms, it starts spell checking all of the fields. How do I get it to check only the fields I want when that field is on a sub-form?
It would be great to turn this into a public action in which you could just put "=spellchecker()" in the on exit event and it would do the rest. Thanks for the help.
I am using the following code (thanks ICEZEBRA) to spell check certain fields upon exit.
Private Sub YOURFIELDNAME_Exit(Cancel As Integer)
Dim strSpell
strSpell = YOURFIELDNAME
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With YOURFIELDNAME
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub
This works great on the main form. However, when I try it on any of the sub-forms, it starts spell checking all of the fields. How do I get it to check only the fields I want when that field is on a sub-form?
It would be great to turn this into a public action in which you could just put "=spellchecker()" in the on exit event and it would do the rest. Thanks for the help.