listbox option in form

I

inquirer

I have a form in excel vb which has a listbox with alternatives option1 and
option2.
Option1 is the default. If option2 is selected I would like to put up a
additional textbox and label on the same form asking for further
information via the textbox. (This textbox and label should not appear when
the form is first opened.)

Is it possible to do this? If so how?

TIA
Chris
 
P

Patrick Molloy

Place the text box on the form and set its visible property to false.
In the option button's change event set the text box visible property to the
value of the option

Private Sub OptionButton2_Change()
TextBox1.Visible = OptionButton2.Value
Label1.Visible= OptionButton2.Value
End Sub
 
I

inquirer

Thanks Patrick, that's what I needed
Chris

Patrick Molloy said:
Place the text box on the form and set its visible property to false.
In the option button's change event set the text box visible property to the
value of the option

Private Sub OptionButton2_Change()
TextBox1.Visible = OptionButton2.Value
Label1.Visible= OptionButton2.Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top