Spell Checking in Forms

  • Thread starter Thread starter Denny G.
  • Start date Start date
D

Denny G.

Access 2002. How can I get the spell checker to limit
its check to a specific text/memo field for a specific
record in a form. Currently, the spell checker, when
activated, wants to check every field in the entire
database. Thanks
 
Hi Denny

To spellcheck in only one field you can use the following code. Hope this
helps

Best regards
Maurice


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
 
Back
Top