Click to See Complete Forum and Search --> : Evaluate


September 22nd, 1999, 10:30 AM
Hello,
I have 12 text boxes. When the "LostFocus" event is triggered, I call a sub routine (see below) "OrderTickers".
I need to capture the the actual text in box X (1-12). Currently my variable is returning the string 'txtTick1.Text' instead of 'AMZN'. How can I capture the string that is in txtTick1.Text?


private Sub OrderTickers(tickNum as Integer)
Dim ii as Integer
Dim MyVal
Dim curVal

curVal = "txtTick" & tickNum & ".Text"
for ii = 1 to 12
MyVal = "txtTick" & ii & ".Text" 'eg: txtTick1.Text (I need to see AMZN)
If len(Trim(MyVal)) > 1 then
MyVal = curVal
End If
next

End Sub

wolfen_76
September 22nd, 1999, 01:50 PM
It is much easier if your text box only diffrent in the index number.. in this case u r using the same name for the text box but differ in index.. so what u've to do is call the textbox by index num.. like this text1(x).text where x is index