relationships, referential integrity and subforms

jshooty

New member
Local time
Today, 03:19
Joined
Sep 15, 2007
Messages
8
If someone can help solve this for me, I would be forever grateful. I have attached the database to which I am referring for clarity.

I am creating a database designed to input data for morbidity and mortality at my hospital. I have set up four main tables: tbldemographics (basic patient information), tbladmissions (information about each different admission a patient may have), tblmorbidity (information about each untoward event suffered by a patient, which I would like to have linked to the specific admission, not just the specific patient), and tblmortality (information about a patient's death, which I would also like to have linked to the specific entry in the admissions table rather than linked to the more general information in the demographics table).

I have created relationships which I thought would work--but with referentail integrity invoked (which it seems like it should be), the very first key stroke on the form that I created to input the data (frmmain) results in an error message that the record can not be added or chaged because related record is required in tbldemographics--and yet this is the table to which I am inputting the data! Turning off referential integrity stops the error, but I don't want to just blindly do that--seems risky.

Problem number two: when I disable referential integrity and enter data into the demographics section of the form, any entry at all results in an automatic entry into the admissions table--even if I haven't entered that part of the subform yet. So if I then exit the form and return later, ANOTHER entry into the admissions table is made--again, even if I have not ventured into that subform yet. So that table winds up with bunches of entries with little to no data, which are NOT cleared up with a compact and compare maneuver.

I'm at a loss on both of these issues. I apologize for the long post, but appreciate any ideas you all might have.
 

Attachments

Sounds like there is an issue with how you have your tables related to each other. Referentail integrity should not be a problem. Can you post a print screen of your relationships as I do not have Access on by home PC.
 
Keith--thanks for your response, and you were correct--there was a relationship problem. It was fixed with the assistance of some folks on another forum--it was a pretty simple fix, I think I had been staring at it too long to see it clearly anymore. Appreciate your offer to help!
 

Users who are viewing this thread

Back
Top Bottom