Getting an Exit event to work...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code to direct a "SetFocus" when the "Tab" Key is pressed, but....it's
unbelievable, but sometimes I CANNOT get the "_Exit" event to run.

Is there ANY WAY to force it to work w/ perhaps a "KeyPress", "KeyUp" or
"KeyDown" event? Also what is the "KeyAscii" for the "Tab" & "Enter" keys??

Is "Tab" 9, & "Enter" (Carriage return) 13???

TIA - Bob
 
Bob Barnes said:
I have code to direct a "SetFocus" when the "Tab" Key is pressed,
but....it's unbelievable, but sometimes I CANNOT get the "_Exit"
event to run.

Is there ANY WAY to force it to work w/ perhaps a "KeyPress", "KeyUp"
or "KeyDown" event? Also what is the "KeyAscii" for the "Tab" &
"Enter" keys??

Is "Tab" 9, & "Enter" (Carriage return) 13???

Yes. However, these particular keystrokes are not going to be
registered by the control in which they are made -- they are received by
the control that gets the focus as a result of processing the keystroke.
So if you have text boxes Text1 and Text2, in that tab order, if the
focus is in Text1 and you press Tab or Enter, the KeyPress event of
*Text2* will fire (with KeyAscii equal to 9 or 13).

But what exactly is the problem with your Exit event, Bob? I've never
known an Exit event not to fire when it should. Of course, if there is
no other control in the form section that can receive the focus, so that
pressing Tab or Enter doesn't send the focus anywhere, then the
control's Exit event won't fire (because it wasn't exited).

Also, the Exit event of a control on a subform won't be fired merely
because you move the focus to the main form, because the original
control still has the *subform's* focus.
 
Dirk - We meet again. You are CORRECT.

I had some TabStops set to False at the User's request. I added an unbound
textbox (very small on the Form so the Exit for run)..then the "SetFocus" in
my code did what I needed.

THANK you - Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top