Philip,
Did you try it in the Form_KeyPress event? Don't forget to set the
KeyPreview to True. By the way, I believe this will only work non-button
type controls.
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub
hth
Jack
----- Original Message -----
From: "Philip Jack" <pkemar@c...>
To: "professional vb" <pro_vb@p...>
Sent: Friday, July 26, 2002 5:58 PM
Subject: [pro_vb] KeyPress To Auto Tab
> Hi all,
>
> I would like some help with this Please.
>
> I have some code to auto tab from one field to the next field but it for
> one field but not the next field. I have nine fields on the form that i
> would like to auto tab with the enter key.
>
> This is the code i have for the field, Would i have to use all the fields
> name for this to work.
>
> This is the code for the first field on the form, I would like code that
> would work all the fields on the form.
>
> Private Sub txtFirstName_KeyPress(KeyAscii As Integer)
> If KeyAscii = vbKeyReturn Then
> SendKeys "{TAB}"
> KeyAscii = 0
> End If
> End Sub
>
>
>
>
> ---
> Visual C# - A Guide for VB6 Developers
> This book will make it easy to transfer your skills
> from Visual Basic 6 to C#, the language of choice
> of the .NET Framework.
> http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
>
>