View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default calling an _Exit event

Don't know if this helps but this is from the VBA Help file:

The Enter and Exit events are similar to the GotFocus and LostFocus events
in Visual Basic. Unlike GotFocus and LostFocus, the Enter and Exit events
don't occur when a form receives or loses the focus.

For example, suppose you select the check box that initiates the Enter
event. If you then select another control in the same form, the Exit event
is initiated for the check box (because focus is moving to a different
object in the same form) and then the Enter event occurs for the second
control on the form.

Because the Enter event occurs before the focus moves to a particular
control, you can use an Enter event procedure to display instructions; for
example, you could use a macro or event procedure to display a small form or
message box identifying the type of data the control typically contains.

Note To prevent the control from losing focus, assign True to the Cancel
argument of the Exit event.




"SMS" wrote in message
...


Hi All...

The _Exit event for a textbox say, is called when leaving the textbox
(anything to cause a loss of focus, it seems).

I am used to being able to call events from code directly (ex: _change
events). This is proving harder for the _Exit event, as it requires a
special cancel argument. Using 0 or 1 or False or True does not work,
as it is not a normal boolean.

Could someone demonstrate for me how to call the _Exit event of a
textbox?

Thank you!

SMS