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 Record in Subform

Status
Not open for further replies.

GR44

Technical User
Jan 13, 2003
6
US
I've got a Main form and a Subform within. I have a button that on the Main form which will add new records to the Main form only. How can I get that button to add a new record to the Subform at the same time? Any help would be appreciated.
 
Hello GR44,
If the parent form is linked to the child form, then you will get a new blank record in the subform when the user adds a new record to the parent form.

To link the parent form and subform; bring up the properties for the subform object in the parent form. Go to the "Data" tab and enter the appropriate values into the "Link Child Fields" and "Link Master Fields" fields. This would normally be the name of the primary key field in your parent form's record source table/query and the name of the foreign key field in your subform's record source table/query.

If they are not linked, by design, then you should allow the user to choose when to add a new record to the subform. Robert
•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•
Professional, affordable, Access database solutions and assistance °•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°•°
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top