Consulting

Results 1 to 3 of 3

Thread: conditioned comboboxes

  1. #1
    VBAX Newbie
    Joined
    Aug 2014
    Posts
    2
    Location

    Question conditioned comboboxes

    Hi to all,
    I am a beginner in VBA so i am sorry if i asked a stupid questions .. and i would say thank you for giving some time to see my tread.
    Without lengthening i will explain my care:

    i have 02 comboBoxs/userform in my example ComboBox6 ComboBox7
    * Combobox6: Reserved to a list of tanks (RSA, RSB,RSD,RSE & RSD)
    * Combobox7: Reserved for tanks Movement (02 choice : "RHM-LINE" or "LINE-UTBS")

    What I want is : fill cells using textboxes which are conditioned by the 02 combo boxes (6 & 7)
    So when I chose an item in the combobox6 saying "RSA" then i have to select in comboBox7 one of the list saying "LINE-RHM"
    after that I will insert values ​​in TextBox38, TextBox39, ... TextBox43 via userform to the cells.
    so,
    if
    ComboBox6 = "RSA" and Combobox7 = "LINE-RHM"
    TextBox38 = "F52"
    TextBox39 = "F53"
    TextBox40 = "M52"
    TextBox41 = "M53"
    TextBox42 = "N52"
    TextBox43 = "N53"

    otherwise

    if
    ComboBox6 = "RSA" and Combobox7 = "LINE-UTBS"
    the values of the ​​TextBoxes will:
    TextBox38 = "F55"
    TextBox39 = "F56"
    TextBox40 = "M55"
    TextBox41 = "M56"
    TextBox42 = "N55"
    TextBox43 = "N56"

    Thanking you in advance, I address my cordial greetings.
    Smail-CH
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Private Sub ComboBox6_Change()
    
        With Me
    
            Select Case .ComboBox6.Value
            
                Case "RSA"
                
                    Select Case .ComboBox7.Value
                    
                        Case "LINE-RHM"
    
                            .TextBox38.Text = "F52"
                            .TextBox39.Text = "F53"
                            .TextBox40.Text = "M52"
                            .TextBox41.Text = "M53"
                            .TextBox42.Text = "N52"
                            .TextBox43.Text = "N53"
    
                        Case "LINE-UTBS"
    
                            .TextBox38.Text = "F55"
                            .TextBox39.Text = "F56"
                            .TextBox40.Text = "M55"
                            .TextBox41.Text = "M56"
                            .TextBox42.Text = "N55"
                            .TextBox43.Text = "N56"
                        End Select
            End Select
        End With
    End Sub
        
    Private Sub ComboBox7_Change()
    
        With Me
    
            Select Case .ComboBox6.Value
            
                Case "RSA"
                
                    Select Case .ComboBox7.Value
                    
                        Case "LINE-RHM"
    
                            .TextBox38.Text = "F52"
                            .TextBox39.Text = "F53"
                            .TextBox40.Text = "M52"
                            .TextBox41.Text = "M53"
                            .TextBox42.Text = "N52"
                            .TextBox43.Text = "N53"
    
                        Case "LINE-UTBS"
    
                            .TextBox38.Text = "F55"
                            .TextBox39.Text = "F56"
                            .TextBox40.Text = "M55"
                            .TextBox41.Text = "M56"
                            .TextBox42.Text = "N55"
                            .TextBox43.Text = "N56"
                        End Select
            End Select
        End With
    End Sub
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Aug 2014
    Posts
    2
    Location
    I test it, but it's not working cells referred of the Textboxes won't be filled !!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •