My options in my combobox are added from my mdb database... what I need is for each time my form, or program for that matter loads is to have the selected option default to the option that was last selected. So essentially, I need my combo box to "remember" which record was the last one selected by the user. Can this be done, seems like it should be simple but I haven't been able to find the answer.
My options in my combobox are added from my mdb database... what I need is for each time my form, or program for that matter loads is to have the selected option default to the option that was last selected. So essentially, I need my combo box to "remember" which record was the last one selected by the user. Can this be done, seems like it should be simple but I haven't been able to find the answer.
Hi
I have used vb.net2002 to solve ur problem I hope it will work.
I have used button to show previous selection u may use another thing according to you. The coding is following
Dim Previous As Integer = 0 Dim Current As Integer = 0 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Previous = Current Current = ComboBox1.SelectedIndex End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox(ComboBox1.Items(Previous)) End Sub
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.