S
Susan H.
I have a parent (tblYouth) and child (tblAddress) tables with one-to-many relationship. I need help setting the correct primary key for tblAddress.
tblYouth
PK YouthID
tblAddress
PK? AddressID (autonumber)
Conc PK? YouthID
Conc PK? AddressBeginDate
Sample Data:
AddressID Youth ID AddressBeginDate AddressEndDate Address
1 5 1/1/2013 3/4/2013 527 Main St.
2 5 3/5/2013 Null 237 Elm St.
3 6 1/1/2013 Null 422 Ash Road
A youth will have many addresses, but the youth cannot have a duplicate AddressBeginDate. More than one youth may have the same AddressBeginDate. The YouthID + AddressBeginDate fields uniquely identify the record. The AddressID also uniquely identifies the record, but I'm wondering if I have to use the concatenated primary key because there can be multiple YouthIDs and multiple AddressBeginDates, but there can't be multiple YouthID + AddressBeginDate. Is using the concatenated fields as the primary key the only way to keep those combined fields unique?
I'll be displaying and updating the latest address record for each youth ona subform, and I'll be using another subform to add records to the tblAddress. Comboboxes will be involved.
Thanks!
tblYouth
PK YouthID
tblAddress
PK? AddressID (autonumber)
Conc PK? YouthID
Conc PK? AddressBeginDate
Sample Data:
AddressID Youth ID AddressBeginDate AddressEndDate Address
1 5 1/1/2013 3/4/2013 527 Main St.
2 5 3/5/2013 Null 237 Elm St.
3 6 1/1/2013 Null 422 Ash Road
A youth will have many addresses, but the youth cannot have a duplicate AddressBeginDate. More than one youth may have the same AddressBeginDate. The YouthID + AddressBeginDate fields uniquely identify the record. The AddressID also uniquely identifies the record, but I'm wondering if I have to use the concatenated primary key because there can be multiple YouthIDs and multiple AddressBeginDates, but there can't be multiple YouthID + AddressBeginDate. Is using the concatenated fields as the primary key the only way to keep those combined fields unique?
I'll be displaying and updating the latest address record for each youth ona subform, and I'll be using another subform to add records to the tblAddress. Comboboxes will be involved.
Thanks!