Subforms - adding new records, etc...

mjwillyone

Registered User.
Local time
Yesterday, 18:55
Joined
Aug 3, 2004
Messages
27
I am creating an Access database that I want to be able to use to change a header table and its associated detail table. I have created a fmain-form that shows the header table fields. This form also has a subform which shows the detail records which are linked to a field in the header table. One header may have many linked detail records from the detail table. I have been able to easily enter information into the detail records that are shown in the subform.

I would like to know how I can add new detail records directly on the subform so that they will automatically pick up the correct header field from the main form. This way I know that the record I add to the sub-form with be linked to the open record of the main form.

Also, I would like to learn a way to sum all of the values of one of the fields shown in the sub-form and place it on the main-form. How can I do this so that I only sum those values that are in the sub-form that are linked to the open man-form record... not sum all of the values from all of the records in the database?

Thank you in advance for your help.

Mike
 
Hi Mike -

If you link the form and subform as parent/child then you should be able to enter detail records and have then get the correct header field (as long as this is the field used to link them).

You can total a field on the sub-form and put it in the subform footer. [You may also be able to refer to this on the main form, but I don't recall if there are some quirks associated with it or not.]

hope that helps,

- g
 

Users who are viewing this thread

Back
Top Bottom