Help Help Help Me in Combo,,Anyone
-
I have filled Combobox value by setting DataSource property, giving Display Member and Value Member, for a particular Table fields in Access-2000 database. I selectd some value of combobox. now when i load that form again, i want to set the previously selected value of combobox. have tried using combobox1selectedvalue = code, also tried out by setting combobox1.text, combobox1.selectedtext, but none of them is working. Its very important will be thankful and grateful if anyone can pull me out of this problem. Thanx :)Be Humble in Victory and Strong in Defeat.:) -Het
-
I have filled Combobox value by setting DataSource property, giving Display Member and Value Member, for a particular Table fields in Access-2000 database. I selectd some value of combobox. now when i load that form again, i want to set the previously selected value of combobox. have tried using combobox1selectedvalue = code, also tried out by setting combobox1.text, combobox1.selectedtext, but none of them is working. Its very important will be thankful and grateful if anyone can pull me out of this problem. Thanx :)Be Humble in Victory and Strong in Defeat.:) -Het
-
I have filled Combobox value by setting DataSource property, giving Display Member and Value Member, for a particular Table fields in Access-2000 database. I selectd some value of combobox. now when i load that form again, i want to set the previously selected value of combobox. have tried using combobox1selectedvalue = code, also tried out by setting combobox1.text, combobox1.selectedtext, but none of them is working. Its very important will be thankful and grateful if anyone can pull me out of this problem. Thanx :)Be Humble in Victory and Strong in Defeat.:) -Het
OK, I created a new Access database with one table, called "States". Then I created a new form, with a
ComboBox
calledcbStates
. I added anOleDbConnection
andOleDbDataAdapter
to the form, and generated aDataSet
calleddsStates
. In theLoad
of the form, I did this:Private Sub Form1\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load daStates.Fill(dsStates, "States") cbStates.SelectedValue = "CA" End Sub
This seems to work correctly. What is the difference between this scenario and what you are trying to do?