If text1 has focus then I need X = text1, if text2 has focus then I need X = text2, if text3 has focus then I need X = text3, etc.
How can I do that?
Printable View
If text1 has focus then I need X = text1, if text2 has focus then I need X = text2, if text3 has focus then I need X = text3, etc.
How can I do that?
Use the ActiveControl Object which is a Reference to whichever Control is Currently Active, (Has Focus), ie.
private Sub Form_Load()
Timer1.Interval = 100
End Sub
private Sub Timer1_Timer()
If TypeOf ActiveControl is TextBox then
Caption = ActiveControl.Text
else
Caption = ""
End If
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Thanks Aaron, just what I needed :)