Spell Checking in Forms

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
 
S

StCyrM

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
 

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