Hi everybody,
I'm having trouble normalizing or setting up relationships for my tables. Here's what I've got so far:
tblPatients:
PatientPrimary# (Number) [Pk]
PatientSecondar y# (Text)
tblPatientInfo:
PatientInfoID (Auto) [Pk]
PatientEpisode (Number)
PatientPrimary# (Number) [Fk]
tblChartInfo:
ChartID (Auto) [Pk]
PatientEpisode [Fk]
ChartItem (Text)
- My relationship between tblPatients and tblPatientInfo is PatientPrimary# -> PatientPrimary#
- My relationship between tblPatientInfo and tblChartInfo is PatientInfoID -> PatientEpisode
Each patient can only have on episode number, but there may be multiple items for ChartInfo per episode. If Patient #100 is on episode 1, they may have 10 chart items for that episode. As of right now, if I enter more than one of the same episode for a patient on the tblPatientInfo, the table will accept it, but it shouldn't.
If I change the primary key of the tblPatientInfo to episode number, then when I enter a value on the tblChartInfo, I can't have multiple items for one episode without have an index/duplicate errors message appear.
What am I doing wrong? I've attached two sample databases...one to show the different primary keys for the tblPatientInfo.
* Just for the record, I posted a similar, although different question on a different forum, but haven't yet gotten a response, so please don't chastise me if you also read that post.
Thanks,
beacon
I'm having trouble normalizing or setting up relationships for my tables. Here's what I've got so far:
tblPatients:
PatientPrimary# (Number) [Pk]
PatientSecondar y# (Text)
tblPatientInfo:
PatientInfoID (Auto) [Pk]
PatientEpisode (Number)
PatientPrimary# (Number) [Fk]
tblChartInfo:
ChartID (Auto) [Pk]
PatientEpisode [Fk]
ChartItem (Text)
- My relationship between tblPatients and tblPatientInfo is PatientPrimary# -> PatientPrimary#
- My relationship between tblPatientInfo and tblChartInfo is PatientInfoID -> PatientEpisode
Each patient can only have on episode number, but there may be multiple items for ChartInfo per episode. If Patient #100 is on episode 1, they may have 10 chart items for that episode. As of right now, if I enter more than one of the same episode for a patient on the tblPatientInfo, the table will accept it, but it shouldn't.
If I change the primary key of the tblPatientInfo to episode number, then when I enter a value on the tblChartInfo, I can't have multiple items for one episode without have an index/duplicate errors message appear.
What am I doing wrong? I've attached two sample databases...one to show the different primary keys for the tblPatientInfo.
* Just for the record, I posted a similar, although different question on a different forum, but haven't yet gotten a response, so please don't chastise me if you also read that post.
Thanks,
beacon
Comment