Yes, the Code does alot of intensive validating which depends on what the user enters.
Actually, in this mdi application when other mdi child forms can be opened and switched to, or when a modal form is opened by a mdi child, it is usuallay not desired to cause validation when focus is changed to a different mdi child form or a modal form, and that is one of the purposes of using the Validate event here - which I took advantage of after introduced back in the mid-late 90's - to be able to validate the control (and cancel) only when changing focus to a control on the same form, because otherwise, the LostFocus would always fire when focus changeing focus to a different form.
Here with the current situation (never had this exact situation before), the user enters a contractor's ID into the edit box (a required field prior to moving to a different control), or after pressing a function key or clicking a search button next to the edit box, selecting a value from a list shown on a modal form - in which case, no validation should occur at that time!!
Validation should also not occur when changing to a different mdi child form.
After selecting/entering and tabbing/clicking to the next control, an option button's value is set based on a preferred default setting for that selected customer. The user can select a different one then.
In the Option button's click event, is also addition validating code for that control.
I understand that an option button's TabStop is only set to TRUE for the option button which has it's Value property also set to TRUE, and all other option buttons TabStop properties are then set to FALSE.
Therefore, it is then this option button - in the above case Option3 - which causes validation of Text1, and needs to be completed by Option3 unless Cancel is set to TRUE.
You are probably right with the SetFocus. This could also be one of those situations which cause problems if a DoEvents in some proceedure is called when this validate event is executing.
So, I guess I will have to come up with a fix, or have the business rules changed as to which control comes next.