Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new child records for existing parent record

Status
Not open for further replies.

cgarmas

Technical User
Jun 16, 2005
37
US
Hello all,
I am creating a database that stores data about patients participating in a health education program. For this purpose I have two tables, Table1 stores demographic and baseline information, with an auto number as the Primary Key and Table2 stores the first intervention done with the patient with a field referencing the Primary Key in table1.
These tables are linked based on a one to many relationship, and I have two forms to enter the data into the two tables.
These patients are supposed to receive three interventions more and I want to be able to enter the next interventions linking them to the first record I created at the first intervention.
To enter the information about the new interventions we open the form for Table2 from the switchboard, which it give us a new empty record not linked to anything. We need some help to figure out how to open the form in an Add mode and retrieve the ID of the patient in question that was created at the first intervention. Can somebody assisst us with this? Thank you very much
 
The usual way is to use the form for Table2 as a linked subform of the first form.
Provided the relationships are properly configured, the subform wizard will do it automatically.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your reply, but my problem is that when we open the form it give us the records that were already enter, and what we would like to do is to prevent problems in altering the data already stored, so we want to create a new record for table2, but retrieving the ID number for the parent record based on some identifying information we have, like for example PatientID and enrollment number, which can identify the ID record in the parent table. I hope this make sense.
 
prevent problems in altering the data already stored
For the subform:
DataEntry=True, AllowAdditions=True, AllowDeletions=False, AllowEdits=False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top