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

Force new record in subform

Status
Not open for further replies.

gemoon

Programmer
Mar 22, 2002
55
0
0
US
I have a form which creates a record in table A. The form has a subform which has several text boxes. The two forms are linked via [FieldB]. When the user creates a new record with the form and enters data in the the subform, a record is created in table C. The new record includes the value of the link, [FieldB]. I would like to force a new record to be created in table C even if the user does not enter data in the subform. The new record should contain the link value [FieldB].

This seems like a simple task, but the solution eludes me.

Does anyone have any suggestions?

Thanks,
Ed
 
Think about on the 'Dirty' event to create a recordset clone of the subform data. Then .AddNew to it with the info you want and where you want it. Then requery the subform.

Use the .NewRecord property to make sure a record is only added when the main form is creating a new record.

Just a thought...
 
How are ya gemoon . . .

I'm not trying to impose this or that, but [purple]whats the point of saving a record that doesn't exist![/purple] ... Is this not a fruitless thing to do?

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top