Spell Check

S

Shawn

I would like to set a form up so after exiting a text box
it will spell check that text box. How do I limit it to
only check one text box at a time? Module? Code?
THX
 
G

Guest

I have the following code attached to a Spell Check
button. When the user has their cursor in a text box, they
can click this button to check the spelling. You could
modify it to do all the text boxes.

Hope this helps
Sandy

Private Sub cmdSpell_Click()
On Error Resume Next

Dim ctlSpell As Control

' Check the spelling in the selected text box
Set ctlSpell = Screen.PreviousControl
If TypeOf ctlSpell Is TextBox Then
If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
MsgBox "There is nothing to spell check."
ctlSpell.SetFocus
Exit Sub
End If
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
Else
MsgBox "Spell check is not available for this
item."
End If

ctlSpell.SetFocus

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top