I have a startup form that prompts the user for a Vendor and one other piece of information. The Vendor is critical as everything else is dependent upon the selection. I have a Vendor_Exit procedure that then loads parameters about the Vendor, etc. and it gives a warning if the Vendor has not been selected. However, I also have a Skip button that allows the user to bypass the startup form and go directly to the next form to perform startup steps manually and there is also a button that allows the user to close the application. The problem is that I get the warning message when the Skip or Close button has been clicked.
According to Microsoft, the event sequence is as follows:
First control:
Exit LostFocus
Second control:
Enter GotFocus MouseDown MouseUp Click
In this case the First control is Vendor and the Second Control is the Skip or Close buttons. As a result, the Vendor_Exit procedure displays the warning message. Is there a way to identify in Vendor_Exit which button was clicked and not display the message?
My alternative is to remove the code from the Vendor_Exit procedure and add a Vendor verification step to the controlxxx_Enter procedure for every other control on the startup form.