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

Add subform record automatically

Status
Not open for further replies.

melaniews

Technical User
Oct 14, 2002
91
US
I have a form based on a query based on two tables -- and a subform based on another table. How do I force the subform to add a record if something changes on the main form.

I'm trying to use the before update property on the main form, but can't seem to see what code I need to write here. The objective is to add a new record to a source table every time something changes in the main table.

Thanks for any guidance here,
Melanie
 
I think you have to add it into the before_update or after_update fields of the individual controls that their change alters the subform. For simplicity you can create one function and just call that function in say, each before_update event.
 
Okay, I can create a module and call it in the various events.

An easy way to do this might be to copy the ID from the main field to the ID in the subform. I tried entering the current date as the default in the field, but it doesn't really add a record until something changes in the subform.

This code must be simple, but I'm not getting it. You can probably tell I'm really new at this. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top