Thank you.
Yesterday (10/04) I decided to reread the "Statements" in VB Language
Reference and I found the sendkeys statement. I tried 9, that did not
work, so I tried vbTab and that did. I did not set keyascii to 0 and
needed to because that stops the beep for the cr. I do not remember
seeing the "{Tab}" notation before, but it works and I will check it
out.
Again Thank you.
Smokey
On Sat, 2 Oct 2004 08:14:02 +0000 (UTC),
er*****@nowhere.com (J
French) wrote:
On Fri, 01 Oct 2004 17:24:11 GMT, Smokey Joe <ol*******@yahoo.com>
wrote:
I would like to program the Enter or Return key to act as the tab does
in text boxes. When I capture a keypress 13 I give the focus to the
next text box but this method skips the validation, implying that I
must validate "manually" or invoke the validate function. before
changing focus.
I thought perhaps I could return the tab value in keyascii but that
did nothing.
Any ideas would be appreciated.
Try this
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub