example) - but an automatic one, just as the TAB key is an automatic
function
inherent in VB forms.
Thanks.
Jorge Cotarelo
e-mail : grup...@statics.com.ar
>>
The solution I need is not a coding solution (not checking KeyAscii=13, for
example) - but an automatic one
<<
Seeing as how you don't want a coding solution... I won't bother giving you
one
(but that is how you would have to do it).
>>
just as the TAB key is an automatic
function
inherent in VB forms.
<<
I take it then you want the enter key to behave like the tab key?
Well, I shouldn't... but here is a coding solution ;)
Sub Form_KeyPress(KeyAscii As Integer)
'Note: Form.KeyPreview = True
Select Case KeyAscii
Case vbKeyReturn
If TypeName(ctl) = "TextBox" Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Select
End Sub
Doug.
Doug.
I would assume, that like me, he uses the Select Case method so that the
procedure is easily expanded to handle other cases. If you are building an
application with a user more acustomed to using keys rather than the mouse,
it is in this event that you would implement most of your keyboard
shortcuts. An If...Then quickly becomes a problem here :-)
--
Ibrahim Malluf
a MS Dev. MVP
_____________________
Malluf Consulting Services
http://www.malluf.com
iyma...@rt66.com
ibr...@malluf.com
Jean Claude NEERUNJUN <jcl...@bow.intnet.mu> wrote in article
<#000GruY...@uppssnewspub04.moswest.msn.net>...
> Just one question:
> If you have chosen to use "Select Case Keyascii" and not "If Keyascii =
",
> is it for performance reason or just a programming habit?
> Jean Claude
> Answer may also be posted to jcl...@bow.intnet.mu
> Doug Marquardt wrote in article
<01bc62c0$61717680$03e8c28e@dmarquardt>...
Doug Marquardt <no_...@dummy.com> wrote in article
>>
I would assume, that like me, he uses the Select Case method so that the
procedure is easily expanded to handle other cases.
<<
You are correct, sir! ;)
Doug.