KeyAscii won't capture the <Tab key
What is the difference between KeyDown and Keyup
The KeyDown occurs when you hit a key with the control in focus and Keyup
when the key is released. If the key is a tab or arrow key (or alt shortcut)
you might only get keydown of the original control and keyup of the newly
activated control. I'm thinking this answer seems too obvious or did you
mean something else!
Regards,
Peter T
"Bill Case" wrote in message
...
Hi Peter;
Thanks; KeyDown solved it. What is the difference between KeyDown and
Keyup
? I know how keyboards work; i.e. scan codes and all that; but
programmaticlly why might I choose KeyDown over KeyUp or viceversa in VBA?
By "execute the right procedures" I meant the two procedures,
"InsertBlankRow
CntrlsOpen", that I had included with my original sample.
Regards Bill
"Peter T" wrote:
Hi Bill,
From help -
"The KeyPress event occurs when the user presses a key that produces a
typeable character (an ANSI key) on a running form while the form or a
control on it has the focus."
Keypress will not return Tab, Enter or Arrow keys
Use either the Keydown or KeyUp events and return Keycode.
What can I do to make <Tab execute the right procedures rather than
jump
to
the first enabled control?
I'm not sure what you mean by "execute the right procedures" but maybe
merely changing the tab orders (Tabindex) will suffice, try the tab
wizard
in View Tab order.
Regards,
Peter T
"Bill Case" wrote in message
...
Hi;
In my procedure below, I need to capture the <LineFeed <Space <Tab
or
<Click. I have managed to redirect everything but the <Tab. I have
tried
various values including 9, "9", Chr(9) and vbTab. Nothing works.
What can I do to make <Tab execute the right procedures rather than
jump
to
the first enabled control? Something in Excel is overriding VBA.
Private Sub EnterButt0_KeyPress(ByVal KeyAscii As
MSForms.ReturnInteger)
If KeyAscii = 9 Then
InsertBlankRow
CntrlsOpen
DayJoinedTxt0.SetFocus
End If
End Sub
Regards Bill
|