[RESOLVED] [2005] Combobox selectedItem
I have a combobox with countries
Britain
USA
Iraq
Kuwait
Iran
Afganistan
I want to assign certian values for each country so i use this select statement but i cant tell why its not working.Any Idea
It gives me my orignal values.
VB Code:
Private a As Double=0
Private b As Double=0
Select Case cbCountries.GetItemText(cbCountries.SelectedItem)
Case "Britain"
a=24.78
b=34.9
Case "USA"
a=10
b=30.8
Case "Iraq"
a=28.1
b=34
End Select
Messagebox.Show(a & ":" & b)
***EDIT****
Got it. I had messed up with something small.
Re: [RESOLVED] [2005] Combobox selectedItem
do you get any error message? i tried this code on my machine and it works perfect.
where do you declare variable a & b? if in SelectedIndexChanged event of the combobox then change private to dim.
regards,
sweet_dreams