Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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