Detecting a click from inside another [event]?

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

Guest

Can I test for an event from inside another event?

For example: I'm in an OnExit event. However, that OnExit event (from a
text-entry field) was precipitated by the clicking of a button. Chan I check,
withing the OnExit event, whether or not an OnClick event has also taken
place? If so, how?

Thanks!
 
Dennis said:
Can I test for an event from inside another event?

For example: I'm in an OnExit event. However, that OnExit event (from
a text-entry field) was precipitated by the clicking of a button.
Chan I check, withing the OnExit event, whether or not an OnClick
event has also taken place? If so, how?

Thanks!

Nope. Exit happens first so as far as the code in that event is concerned
the Click is in the future.
 
Thanks for your reply. FYI, I recently found a workaround. Since the clicked
button is the currently ActiveControl (even though the OnExit is being
performed), inserting this code in the OnExit event will allow you to take
action based on the button-click:

Dim ctlCC As Control
Set ctlCC = Me.ActiveControl

If ctlCC.Name = "frmPRTR_submit" Then
Call frmPRTR_submit_Click
Exit Sub
End If


Now ain't THAT kewl.....
 
Back
Top