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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1 control to 2 seperate tables simultaneously 1

Status
Not open for further replies.

natesin

MIS
Mar 13, 2001
128
US
Can some one help me? I have a bound cotrol on a form bound to a table. When the data is updated I would like it to put the data on the bound table and also another table that is a subform on this main form.

I know how to make it requery once it is updated so the form will reflect the change. I am just missing the bit of code to enter the data to multiple tables at the same time.

Any help would be greatly appreciated!
 
Not a good practice. Nor is it necessary. This is referred to as duplicating data and does not follow the Forms of Data Normalization. Why do you feel the need to do this? What purpose is this serving? I'm sure there is a way to accomplish what you need without "breaking the rules".
 
I am constructing this database from an existing database since 1988. It is for a hospital anesthesiology department and what information they need at the time of the interview for a operation. The bound control is for the planned surgery which is a current table and the surgeries is the the subform (table of past surgeries). It would be the only duplicate data in database. I just wanted it to show in both places. I appreciate the help. You have put me on the right track about thinking this through again. If you do know a way it would be helpful to know.

Thank you Jerry....
 
This scenario is a classic many-to-many relationship. I'm going to assume you have many patients and many procedures. Each patient can have one or more procedure performed(whether or not at the same time). For this you would need a minimum of three tables. One for patients, one for procedures, and one to link the two. The intermediate or patient/procedure table would need at a minimum a foreign key field to each of the other two tables. I would not set these two fields as a compound primary key(we must assume that a patient could have the same procedure performed more than once).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top