Indeed, sorry about that, I mucked around with my values to make it easier
to understand for me as much as anything!
You're right though, I wasnt entering valid options into my list! I now
have this kind of thing(Actual code this time!)
Dim Coption As New ComboItem
Coption.Name = "Unacceptab le"
Coption.OptionV alue = 100
aComboBox.Items .Add(Coption)
Dim Coption2 As New ComboItem
Coption2.Name = "Major Non-Compliance"
Coption2.Option Value = 50
aComboBox.Items .Add(Coption2)
Dim Coption3 As New ComboItem
Coption3.Name = "Minor Non-Compliance"
Coption3.Option Value = 20
aComboBox.Items .Add(Coption3)
Dim Coption4 As New ComboItem
Coption4.Name = "Satisfacto ry"
Coption4.Option Value = 9
aComboBox.Items .Add(Coption4)
and now it works! Thanks a lot, i'm certainly beginning to get my head
around all this stuff now and it's kinda clever !
Cheers,
Dan
PS: Is there any other better way i should be doing the above?
Once again thanks for the help. I now have a dynamic database driven form
with soon to have dynamic options in the combo's too :o)
"Fergus Cooney" <fi******@tesco .net> wrote in message
news:eI******** ******@tk2msftn gp13.phx.gbl...
Hi Dan,
Helping is tricky.
Return i.Items.Item(a) .OptionValue
Where did 'i' jump up from? It tells me that the posted code isn't the
running code, and that's where the tricky comes in.
Whatever Items(a) gives, it's going to have to be cast into the
correct type so that you can see the OptionValue property.
How about writing a debug routine which will simply Console.WriteLi ne
each of the Items in the given ComboBox? You can call it with ACombo to
determine whether you can get <any> valid OptionValues out of it. Then worry about
getting the <correct> one.
Regards,
Fergus