this has always perplexed me...
on a control's LostFocus() event, i have this code:me.control_name.visible = Falsewhich results in the run-time error 2165: 'You cannot hide a control that has focus'
-->but didn't the control just loose focus (?)
______________________________________
background:
i have a control that becomes visible based on user choices (at other controls.) i am looking to hide that control if the user clicks ANYWHERE else on the form (i.e. chooses to ignore this control - which is OK). The form has a lot of controls, so putting code behind each of their OnFocus event to close this one control is not really a practical approach. Thought about putting a timer on it, but that seems a bit heavy handed (maybe?)
as always, with appreciation in advance,
m.