M
moondaddy
I have a form where I need to get the value from a number of textboxes in a
single event. If the textbox has the focus I can use code like this: var =
mytextbox.text, but if it doesn't have the focus (which all but one can't
have the focus) I'll get an err msg saying you cant reference a control if
it doesn't have the focus. So now if I use code like this: var = mytextbox,
I sometimes get different results and I haven't figured out why/when they
happen that way, but the 2 different results are these:
1) I get the value returned from the text in the textbox (which is what I
expect)
or
2) mytextbox returns a value of null even when there's text in it, in which
case var = mytextbox returns an err because I'm trying to make var equal to
null.
This behavior is inconsistent and very frustrating. in vb6 and vb.net I can
get the value from mytextbox.text even when it doesn't have the focus.
Can anyone please advise on how to consistently get the value from
mytextbox. Note, for reasons, I cant use events like mytextbox.onchange. I
need to capture all the values from all the textboxes in a single event so
most of them wont have the focus.
Thanks.
single event. If the textbox has the focus I can use code like this: var =
mytextbox.text, but if it doesn't have the focus (which all but one can't
have the focus) I'll get an err msg saying you cant reference a control if
it doesn't have the focus. So now if I use code like this: var = mytextbox,
I sometimes get different results and I haven't figured out why/when they
happen that way, but the 2 different results are these:
1) I get the value returned from the text in the textbox (which is what I
expect)
or
2) mytextbox returns a value of null even when there's text in it, in which
case var = mytextbox returns an err because I'm trying to make var equal to
null.
This behavior is inconsistent and very frustrating. in vb6 and vb.net I can
get the value from mytextbox.text even when it doesn't have the focus.
Can anyone please advise on how to consistently get the value from
mytextbox. Note, for reasons, I cant use events like mytextbox.onchange. I
need to capture all the values from all the textboxes in a single event so
most of them wont have the focus.
Thanks.