Data Relation? Newbe question

  • Thread starter Thread starter Ginger Estherskip
  • Start date Start date
G

Ginger Estherskip

I'm setting up a dataset using the GUI to have a Parent Data Table and a few
Child Data Tables.

I then have a form that uses that dataset, and I can fill the appropriate
datatables et. al., but I can't figure out how that parent/child
relationship gets enforced? It's a one to one relationship, and when I bind
a textedit to the child table row, it's not the row that matches the
relation with the parent table.

Pretend it's a Shirt

Parent Table Shirts:
Name: Polo Shirt
ColorCode: 3

Child Table Colors:
1 Red
2 Blue
3 Green


Instead of seeing "Green" on the edit form, I see "Red" as if the relation
hasn't been enforced. I'm sure I'm missing something obvious!
 
I'm assuming you are using data binding?

You need to set the source of the child's field to the relation between the
two tables, not to the parent table or the child table. If you are using a
BindingSource, you need a separate one for the ChildTableColors.

Robin S.
 
Back
Top