combo box code wont work

Discussion in 'AutoCAD' started by johnbortoli, Mar 1, 2005.

  1. johnbortoli

    johnbortoli Guest

    why wont this work.
    I ahve auser form with 2 comboboxes.
    1. cboNumberStrands
    2. cboStrandType
    theory is
    if combo2 = 12.7 then combo1 lists 2,3,4,5,
    if combo2 = 15.2 then combo1 lists 6,7,8,9
    My code looks like this

    Private Sub UserForm_Initialize()
    CboStrandType.AddItem "12.7mm"
    CboStrandType.AddItem "15.2mm"
    CboStrandType.ListIndex = 0

    If CboStrandType.Text = "12.7mm" Then
    CboNumberStrands.AddItem "2s"
    CboNumberStrands.AddItem "3s"
    CboNumberStrands.AddItem "4s"
    CboNumberStrands.AddItem "5s"
    CboNumberStrands.ListIndex = 0
    ' End If

    Else
    CboStrandType.Text = "15.2mm"
    CboNumberStrands.AddItem "6s"
    CboNumberStrands.AddItem "7s"
    CboNumberStrands.AddItem "8s"
    CboNumberStrands.AddItem "9s"
    CboNumberStrands.ListIndex = 0
    End If
    End Sub

    johnb
     
    johnbortoli, Mar 1, 2005
    #1
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 (here). After that, you can post your question and our members will help you out.