-
combo box lookup
I have created a form that holds a customer's account information. One of the fields is a combo box that contains a policy description. I want one of the fields to be a combo box that contains a list of descriptions and an id for each description. I want the combo box to select the proper policy description according to that customer's policy id. When I set the form to "edit" I want the user to be able to select a new policy and save that policy's id. If possible, I would like the id to be invisible to the user. Thanks in advance.
-
Well if it's invisible to the user, why have the id on the form at all? Store it in a db, delimited text file, whatever you want, associated with the policy.
-
I have looked through your post, and I see no real question..
What is it you want exactly?
Also, post your code here, let us help you out without playing a guessing game.
-
The answer to the question is to bind the combo box to the dataset, setting the valuemember, datasource, and displaymember properties and then reference the valuemember I'm looking for with:
combobox.selectedvalue = id
This sets the combo box to display the appropriate value.