L
Lee Ottaway
I have a class called cComboItem which I use to add two bits of data,
ID and Description which I then add to my combobox using the following
code:
Do While rd.Read()
Dim oItem As New cComboItem(rd("ID"), rd("Description"))
cboProviderType.Items.Add(oItem)
Loop
I then store just the selected ID field against the provider. However
once this form is closed and I re-open it, I want to be able to set
the selecteditem of the combobox back to proper entry using the ID
that has been stored in the database. I know I could loop through the
Provider Type table until I find the matching ID and put that text
into the combobox but there must be a way of simply saying to the
combo, here's the ID, now display me the description field that
matches this.
Any ideas?
Lee
ID and Description which I then add to my combobox using the following
code:
Do While rd.Read()
Dim oItem As New cComboItem(rd("ID"), rd("Description"))
cboProviderType.Items.Add(oItem)
Loop
I then store just the selected ID field against the provider. However
once this form is closed and I re-open it, I want to be able to set
the selecteditem of the combobox back to proper entry using the ID
that has been stored in the database. I know I could loop through the
Provider Type table until I find the matching ID and put that text
into the combobox but there must be a way of simply saying to the
combo, here's the ID, now display me the description field that
matches this.
Any ideas?
Lee