[RESOLVED] Easy way to pick another text box depending on an option
Hello,
Here's my problem.
Depending on an option chosen by the user, another text box should be filled with data that is coming from a text file.
I know you can do something with a select case or an if then, but if I do that, I will have to adapt the code in a lot of different places.
So I was wondering, if something like this possible:
if opt1 then
textboxtouse = textbox1
else
textboxtouse = textbox 2
end if
Thanks in advance.
Re: Easy way to pick another text box depending on an option
vb Code:
Dim ctlTextBox As Control
If Opt1.Value Then
Set ctlTextBox = Text1
ElseIf Opt2.Value Then
Set ctlTextBox = Text2
End If
Then, in the code that loads stuff to a textbox, use ctlTextBox instead of the TextBox name.
When you're all done using ctlTextBox, don't forget to delete it:
Re: Easy way to pick another text box depending on an option
Sorry for the late reply.
I've been extremely busy with other things.
It works. :thumb:
Thanks :)