Results 1 to 2 of 2
2011-03-22, 17:13 #1
Code to add additional info after an item in a combo box has been selected.
I have created a template with a userform that has a combo box with 3 items listed in it:
If the users choose "non member," or "applicant," items, that text is inserted into the document and that's the end of that. If they choose the "member" item, then I want the user to be able to add a member number like the example below.
I will add a text box for the additional member no. to be entered, but I don't know how to make it work. All help will be appreciated. Thanks.
2011-03-22, 18:21 #2
- Join Date
- Dec 2000
- New York, NY
- Thanked 29 Times in 27 Posts
Here's one way to do it:
Private Sub cboMemberStatus_Change() Select Case cboMemberStatus.Text Case "Member" lblMemberNo.Enabled = True txtMemberNo.Enabled = True Case Else lblMemberNo.Enabled = False txtMemberNo.Enabled = False txtMemberNo.Text = "" End Select End Sub
You could also toggle the visibility of the label and textbox if you prefer.