none
Combo box choice determines form displayed RRS feed

  • Question

  • Have four different sets of questions, and I want to create a form, where the user have the option to select Option1, Option2, Option3 etc. from a drop down box.  Depending on their selection, a set of question will appear, pertaining to their choice.  How do I achieve this?

    Wednesday, October 30, 2013 8:56 PM

Answers

  • Hi,

    If I understand correctly, you want to create a form and a comb box with several options. When you select different options in the combo box, the related setting of questions should be displayed in the form. Please correct me if I have any misunderstanding.

    I think a User form with VBA macro can help you to approach the goal.

    I write a sample for your reference. In my sample, I just declare four questions to display as a label in the user form.

    Private Sub UserForm_Initialize()
        ComboBox1.AddItem "Option1"
        ComboBox1.AddItem "Option2"
        ComboBox1.AddItem "Option3"
        ComboBox1.AddItem "Option4"
        Label2.Caption = ""
    End Sub
    
    Private Sub ComboBox1_Change()
        Dim cond(4) As String
        cond(0) = "Question1:xxxx?"
        cond(1) = "Question2:xxxx?"
        cond(2) = "Question3:xxxx?"
        cond(3) = "Question4:xxxx?"
        
       Select Case ComboBox1.Value
          Case "Option1"
            Label2.Caption = cond(0)
          Case "Option2"
            Label2.Caption = cond(1)
          Case "Option3"
            Label2.Caption = cond(2)
          Case "Option4"
            Label2.Caption = cond(3)
          Case ""
            Label2.Caption = ""
       End Select
    End Sub

    Here is the sample document: http://sdrv.ms/Hihdzk

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 1, 2013 9:15 AM
    Moderator