I am new to vb and trying hard to learn - I have made a program that has a form with a combobox that has the provinces of canada listed. when the record is stored into my table in access - the str value of either NS, NB, PE, etc is stored rather then the listindex #. I want the user to be able to edit a record if need be and I have another form for editing and want the values that are read fromt he database to fill in the values on the form. I have all of this working except the cboProvince box. If the person is from "ON" I want the cboProvince box to show that when the edit form with all their recorded info shows up but can not get it to do it.
I have the basic idea but do not know the proper syntax to do it.
Select Case strProvince
Case "NS"
intProvince = 0
Case "NB"
intProvince = 1
Case "PE"
intProvince = 2
Case "NL"
intProvince = 3
Case "QC"
intProvince = 4
Case "ON"
intProvince = 5
Case "MB"
intProvince = 6
Case "SK"
intProvince = 7
Case "AB"
intProvince = 8
Case "BC"
intProvince = 9
Case "YT"
intProvince = 10
Case "NU"
intProvince = 11
Case "NT"
intProvince = 12
End Select
'.cboProvince.ListIndex = 12 - intProvince
Could someone please steer me in the proper direction. I have tried various things for a long time and can't get it working.