Using spell check

J

John Baker

Hi all

I have a button on a form to do a spell check. I use code :
DoCmd.RunCommand acCmdSpelling

I would like to restrict the spell check to just check the current record
only. Is this possible.
At the moment it checks the current record but then goes off and checks all
other records also.

Also I would like the button to be able to spell check the fields in the
subforms on the main form.
How would I do this?

John Baker
 
F

fredg

Hi all

I have a button on a form to do a spell check. I use code :
DoCmd.RunCommand acCmdSpelling

I would like to restrict the spell check to just check the current record
only. Is this possible.
At the moment it checks the current record but then goes off and checks all
other records also.

Also I would like the button to be able to spell check the fields in the
subforms on the main form.
How would I do this?

John Baker

From a recent post my Maurice St Cyr:

To spell check the current record and field use the following:

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


Hope this helps

Maurice St-Cyr
Micro Systems Consultants, Inc
 

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