J
J.P.
I'm having a problem with spell checking a textbox field using
acCmdSpellCheck. Here is the code:
Me.myTextBox.SetFocus
Me.myTextBox.SelStart = 0 ' bombs here, says the control needs focus
Me.myTextBox.SelLength = Len(Me.myTextBox)
DoCmd.RunCommand acCmdSpellCheck
If I insert:
MsgBox Screen.ActiveControl.Name
directly after:
Me.myTextBox.SetFocus
The control does indeed have focus, but when I try to set the SelStart
property the code bombs complaining that the control does not have
focus. This code is being executed in the click event for a button on
the form.
Any ideas on what may be going wrong would be greatly appreciated.
Thanks,
J.P.
acCmdSpellCheck. Here is the code:
Me.myTextBox.SetFocus
Me.myTextBox.SelStart = 0 ' bombs here, says the control needs focus
Me.myTextBox.SelLength = Len(Me.myTextBox)
DoCmd.RunCommand acCmdSpellCheck
If I insert:
MsgBox Screen.ActiveControl.Name
directly after:
Me.myTextBox.SetFocus
The control does indeed have focus, but when I try to set the SelStart
property the code bombs complaining that the control does not have
focus. This code is being executed in the click event for a button on
the form.
Any ideas on what may be going wrong would be greatly appreciated.
Thanks,
J.P.