How to Keep Spell Check On Current Record


J

JamesJ

In my access 2007 single record form I have 'Spell Check' on the shortcut
menu from a macro.
When I select 'Spell Check' it will check the current record then proceed to
check other records in the
table even though I have the Cycle property of the form set to Current
Record.
Is there any way to prevent the Spell Check from "leaving" the current
record??

Thanks,
James
 
Ad

Advertisements

J

JamesJ

Seems to work ok but I'm getting a 'Can't move focus to MyRecordID'.
'MyRecordID'
is a hidden autonumber field. The debug window highlights '.SetFocus'.
Placing an 'On Error Resume Next' before this eliminates the error.
Although I don’t
know if that's good or bad.

James
 
D

Douglas J. Steele

It makes sense that you can't set focus to a hidden control, since focus
specifically refers to the ability of a control to accept input.

Try changing

If TypeOf ctlSpell Is TextBox Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If

to

If TypeOf ctlSpell Is TextBox Then
If ctlSpell.Visible = True Then
If Len(ctlSpell) > 0 Then
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
End If
End If
End If
 
Ad

Advertisements


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