Link to home
Start Free TrialLog in
Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda

asked on

selecting a combobox item at runtime.

I am using a combBox, I want to select an item at runtime. When the form is loading the combbox is populated with values. At one time I have to populate the form with data from the database. When editing is done on the form it should replace the original form. below is a line from my code.

 Me.tlevel.Text = gcl.ReturnLevel(drd("tlevel"))

tlevel is a combobox, drd("tlevel") is a level id from a datareader "drd". actually it the (index of the selected item in the combobox) + 1, so gcl.ReturnLevel(drd("tlevel")) displays the label for that index.  But as it is loading I want it also selected because when iam saving i read the (id of the selected item) + 1 and i save that value. i use structures to populate the combobox. I am using vb.net.
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial