Hi
I've created a number of conditional drop-down lists in a userform. Where the section made in one field will affect the list that's returned in another. Now most of the lists are working fine but there's just this one that is unrelenting and refusing to work. When you click on the drop-down it brings back a blank field. I've checked as far as I know and cannot find the error anywhere. It was working fine after I had added the code but suddenly stopped working. Below is the code - where I want it to lists of Skills in the Skills ComboBox.
Any ideas of where I'm going wrong or what I need to change?
I've created a number of conditional drop-down lists in a userform. Where the section made in one field will affect the list that's returned in another. Now most of the lists are working fine but there's just this one that is unrelenting and refusing to work. When you click on the drop-down it brings back a blank field. I've checked as far as I know and cannot find the error anywhere. It was working fine after I had added the code but suddenly stopped working. Below is the code - where I want it to lists of Skills in the Skills ComboBox.
Code:
Private Sub WorkCategory_Change()'Returns details of activity
If StatsCapture.WorkCategory.Value = "Year End - PinPoint" Then
StatsCapture.ActivityTextBox.RowSource = "Year_End"
ElseIf StatsCapture.WorkCategory.Value = "Year End - DISCribe" Then
StatsCapture.ActivityTextBox.RowSource = "Year_End"
ElseIf StatsCapture.WorkCategory.Value = "Additional Work" Then
StatsCapture.ActivityTextBox.RowSource = "Additional_work"
ElseIf StatsCapture.WorkCategory.Value = "Downtime" Then
StatsCapture.ActivityTextBox.RowSource = "Downtime"
Else
StatsCapture.ActivityTextBox.RowSource = "Activity"
Exit Sub
End If
'Returns the alert category
If StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Health" Then
StatsCapture.Skill.RowSource = "Health_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "InHouse" Then
StatsCapture.Skill.RowSource = "InHouse_Skill"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Vitality - V302" Then
StatsCapture.Skill.RowSource = "Vitality_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "DiscoveryCard - V302" Then
StatsCapture.Skill.RowSource = "Card_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Insure - A100" Then
StatsCapture.Skill.RowSource = "Insure_Skill"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Group Life - G606" Then
StatsCapture.Skill.RowSource = "Life_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Individual Life - I638" Then
StatsCapture.Skill.RowSource = "Life_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Invest DrO - 638" Then
StatsCapture.Skill.RowSource = "Invest_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Invest non-DrO - 634" Then
StatsCapture.Skill.RowSource = "Invest_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "Discovery Sales" Then
StatsCapture.Skill.RowSource = "Sales_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "The Vitality Group" Then
StatsCapture.Skill.RowSource = "TVG_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "VitalityHealth" Then
StatsCapture.Skill.RowSource = "Vitality_Health_Skills"
ElseIf StatsCapture.WorkCategory.Value = "Alert" And StatsCapture.Company.Value = "VitalityLife - Q621" Then
StatsCapture.Skill.RowSource = "VitalityLife_Skills"
Else
StatsCapture.Skill.RowSource = ""
Exit Sub
End If
End Sub
Any ideas of where I'm going wrong or what I need to change?