How to Keep Spell Check On Current Record

  • Thread starter Thread starter JamesJ
  • Start date Start date
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
 
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
 
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
 
Back
Top