SelectionChangeCommitted() Event not working?

I have several ComboBox controls on my a Form. Each of these are within a separate panel control (5 panels, 1 combobox per panel).

I'm using the SelectionChangeCommitted() Event for each of these comboboxes. My problem is that when I select a value, it executes the event but the value is nothing. I then select the same value again and then it has a value and it executes the way it is suppose to. Why is it taking 2 times to get a value? Here is just one of the Event Procedures below. I just use one because the rest are just like it...with the exception of the field name.

        Private Sub cmbTApprover_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cmbTApprover.SelectionChangeCommitted
        Try
                strErr = ""

                If cmbTApprover.Text.Length > 0 Then
                    ptLoc = cmbTApprover.PointToScreen(New Point(0, 0))
                    ptLoc.Y += cmbTApprover.Height + 5

                    gstrApprover = cmbTApprover.Text

                    If GetApproverPassword() Then
                        btnUpdate.Enabled = True
                    End If
                End If

        Catch ex As Exception
            strErr = gfrmID & "/cmbTApprover_SelectionChangeCommitted() - " & ex.Message & ",E"
        End Try

        ProcessMessages(Me, sbr, strErr)
    End Sub
BlakeMcKennaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Hi.. BlakeMcKenna...

This seems to be logic due to theory if your Combobox at your first Selection is Empty
(SelectedIndex=-1)


ComboBox.SelectionChangeCommitted Event
Occurs when the selected item has changed and that change is displayed in the ComboBox.

Just for try ..set your SelectedIndex other than -1 and fire the event ..

Yiannis
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlakeMcKennaAuthor Commented:
jtoutou...you were right...it was a logic issue!

Thanks
0
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Glad i guide you!!

Yiannis
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.