Setting value of Combo...People with more white brain cells suggested to view this,,,,
-
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
How about
combo1.listindex = lSomeVal
. Would that fit the bill "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox -
How about
combo1.listindex = lSomeVal
. Would that fit the bill "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox -
I use the code below to do what (I think) you need to do...
'Now set the combo to show the propDB stored in the .ini file For i = 0 To cmbPropDB.ListCount If cmbPropDB.List(i) = gstrPropDB Then cmbPropDB.ListIndex = i Exit For End If Next i
The thing that might be causing it to work on my machine and not on yours is because I've set my combo box type to DropDownList - this means that the user can't type directly into the edit area, but must select from the list. Let me know a bit more info, and will see if can sort it out for you if you like... "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox