Is there a way for me to know if or which command button was just
clicked that triggers the LostFocus event for the current control on a
Form?
I have a form that has many types of users who each have their own set
of fields they can change. Therefore I use setfocus property in the
lostfocus event for some of the users to get from one control to
another. Since I am "directing traffic" with setfocus, the users are
unable to use the record navigation buttons I created to go back and
forth between records. The user presses the GetPreviousRecord button,
the lostfocus event of the current control is triggered, and the
setfocus code forces the user to the next control ignoring that the
user wants to go to the next record. How can I determine that I
pressed the GetPreviousRecord button so I can go to the previous
record and ignore the setfocus code for the next control?
From MS help under lostfocus event:
If you move the focus to a control on a form, and that control doesn't
have the focus on that form, the Exit and LostFocus events for the
control that does have the focus on the form occur before the Enter
and GotFocus events for the control you moved to.
Is there anyway I can see the control that is going to get the Enter
Event before exiting the current control?
Thanks for your help!