Show text box after selecting value list value

S

steve

I have a value list with three pre-defined values (listed under "row source"
in the properties). I also have three bound text boxes on the same form
that are going to be related to these values. Is there a way to only make
visible the text box that should be associated with a certain value when the
value is selected from the list (i.e. text box "Name" appears on the form
after the value "First Name" is selected in the pull down menu of the value
list box)?
 
K

Kevin Sprinkel

Sure; use a Select Case statement in the AfterUpdate event
of the pre-defined list control:

Select Case Me!YourListControlName
Case "Name"
Me!TextBox1.Visible = True
Me!TextBox2.Visible = False
Me!TextBox3.Visible = False
Case "2ndvalue"
Me!TextBox1.Visible = False
Me!TextBox2.Visible = True
Me!TextBox3.Visible = False
Case "3rdvalue"
Me!TextBox1.Visible = False
Me!TextBox2.Visible = False
Me!TextBox3.Visible = True
Case Else
' If value is deleted, either show all or hide all
Me!TextBox1.Visible = False
Me!TextBox2.Visible = False
Me!TextBox3.Visible = False

End Select

HTH
Kevin Sprinkel
 

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