View Full Version : tab from sub to mainform related questions. . .


WebFaktor
03-10-2002, 09:06 AM
Hello,

I'm looking to learn a way by which I can tab from a subform to its mainform without updating the subform (1 time entered) recordset until I am finished entering the mainform's (many times entered) recordsets.

The sub and mainforms are each directed to different queries/tables. I did this to accomplish a one-to-many relationship (subform = one, mainform = many.) In short, the record set a user would enter 1 time into the subform needs relate to many different record sets they can enter within the mainform.

2nd Related Question: I'm looking for a user friendly way to link the sub and main forms records. What I'm trying to do is place a hidden key field within the mainform that would replicate the key field information entered 1 time in the subform for each of the many mainform recordset.

I'm somewhat of a novice at this and could you send me code samples and instructions it would be much appreciated!

Technologically challenged,

Michael

Pat Hartman
03-10-2002, 11:22 AM
With a 1-to-many relationship, the main form displays the 1-side table and the sub-form displays the many-side table. Then when you set the master/child links properly, Access will automatically populate the foreign key fields of the subform so they match those of the main form.

The 1-side table needs to be saved prior to any related many-side records or you won't be able to enforce referential integrity.