Binding ComboBox

G

Guest

I'm attempting to bind a combobox to store the values in
tblProblems.VersionID and display the Version value from the tblVersions.
The VersionID field is a foreign key to the ID in tblVersions. Currently I
have the combobox displaying the versions in the dropdown which is what I
need but when I select a different version it is displayed for every record
(apparently not bound to the value of VersionID in tblProblems.

Documentation that I have is confusing and doesn't really address my
situation of using the validation table. I routinely use this technique in
Microsoft Access but the control binds very differently.

TABLES
--------------
tblProblems.VersionID (1)

tblVersions.ID (1)
tblVersions.Version (1.0.1)

RELATIONSHIPS
-------------
ProblemsVersionIDColumn = DataSet11.Tables("tblProblems").Columns("VersionID")
VersionsKeyColumn = DataSet11.Tables("tblVersions").Columns("ID")
problemsversions = New DataRelation("problemsversions",
ProblemsVersionIDColumn, VersionsKeyColumn)
DataSet11.Relations.Add(problemsversions)

COMBOBOX PROPERTIES
---------------------
DataSource tblVersions
DisplayMember - Version
ValueMember - ID

DataBindings.SelectedItem (None)
DataBindings.SelectedValue (None)
DataBindings.Text (DataSet11 - tblProblems.VersionID)
 
G

Guest

when I select a different version it is displayed for every record
(apparently not bound to the value of VersionID in tblProblems.

When I move the form from record to record I expected the relationship to
cause the combobox to display the version number related to the record being
viewd, and it doesn't.

tblProblems.VersionID -> FORM (COMBO) <-- tblVersions.ID (Value),
tblVersions.Version (Display)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top