Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

combo boxes in vb6


  • Please log in to reply

#1
widget5

widget5

    New Member

  • Member
  • Pip
  • 1 posts
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.
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP