Hi,
I have a form with several controls that must be populated before the OK button is enabled. The controls are either combo boxes or text boxes. In the OnChange event of each of the relevant controls I run a function. The function tries to check that each of the controls is populated. The problem arises when I try to check the contents of the text box. If I try to check the Text property, it will only work when the control has the focus (otherwise produces run-time error 2185). If I try to check the Value property, it will only work when the text box does not have the focus. This is no help if this is the first time I have entered anything in the text box, because the Value property is not updated until focus moves off the text box. Is there a solution to this, or am I asking too much ? Sorry this is a bit long winded !
I have a form with several controls that must be populated before the OK button is enabled. The controls are either combo boxes or text boxes. In the OnChange event of each of the relevant controls I run a function. The function tries to check that each of the controls is populated. The problem arises when I try to check the contents of the text box. If I try to check the Text property, it will only work when the control has the focus (otherwise produces run-time error 2185). If I try to check the Value property, it will only work when the text box does not have the focus. This is no help if this is the first time I have entered anything in the text box, because the Value property is not updated until focus moves off the text box. Is there a solution to this, or am I asking too much ? Sorry this is a bit long winded !