Question Combo box / Database

nebakanezzar

Member
Joined
Apr 2, 2010
Messages
6
Programming Experience
Beginner
Hey All,

first, this is an awesome site! what a wealth of info!

so, i am using VB express and access 2007. i have a combobox linked to be populated by an access table. this seems to work fine when i debug, but when i try and select an item in the combobox i get the following error:

"column 'Doc_ID' is constrained to be unique. value 8 is already present."

in the data binding i have it set as:
Data source - my datasource
display member - Doc_ID
value member - null
selected value - null

'Doc_ID' is the primary key in the table i linked. what i want to do is to be able to select an existing record in the combo box, which fills in texts boxes with he related fields of that record, and then edit the fields as/if necessary.

hope that makes sense.

Thanx.
 
If you want the combo to serve as a navigator, set its style to DropDownList and remove any databindings you find under the (DataBindings) property item. Only your datasource and displaymember should be bound
 
Thanx cjard! your walk throughs are great btw!

one more quickie, one of the objects filled by the Doc_ID combobox(1) is another combobox(2).
when i select the Doc_ID in combobox 1, combobox 2 shows the related field for that record. when i click on combobox2 it lists the all the records for that field. is there a way to have it only list the options for that field?

i hope that makes sense.

thanx again.
 
Back
Top