I have a combo box that contains dept numbers. I would like to update another field based on the dept number selection.
The "IfElse Then" statement works well when both fieds are text boxes. Does not work at all when selection is combo and the other is text.
Works:
Private Sub Dept_TextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
If Dept_TextBox.Text = "t2550" Then
BusinessUnitTextBox.Text = "SPBU"
ElseIf Dept_TextBox.Text = "t2441" Then
BusinessUnitTextBox.Text = "SPBU"
ETC ......
End If
Doesn't Work:
Private Sub Dept_ComboBox_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dept_ComboBox.SelectedIndexChanged
If Dept_ComboBox.Text = "T2550" Then
BusinessUnitTextBox.Text = "SPBU"
ElseIf Dept_ComboBox.Text = "t2441" Then
BusinessUnitTextBox.Text = "SPBU"
ETC .......
End If
I know its simple but I am getting ready to throw something
Thanks
The "IfElse Then" statement works well when both fieds are text boxes. Does not work at all when selection is combo and the other is text.
Works:
Private Sub Dept_TextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
If Dept_TextBox.Text = "t2550" Then
BusinessUnitTextBox.Text = "SPBU"
ElseIf Dept_TextBox.Text = "t2441" Then
BusinessUnitTextBox.Text = "SPBU"
ETC ......
End If
Doesn't Work:
Private Sub Dept_ComboBox_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dept_ComboBox.SelectedIndexChanged
If Dept_ComboBox.Text = "T2550" Then
BusinessUnitTextBox.Text = "SPBU"
ElseIf Dept_ComboBox.Text = "t2441" Then
BusinessUnitTextBox.Text = "SPBU"
ETC .......
End If
I know its simple but I am getting ready to throw something
Thanks