Order of inserting new records...

madEG

Registered User.
Local time
Today, 09:53
Joined
Jan 26, 2007
Messages
307
Hello,

I have a form that is to control two table's information: Person, and PersonContactInfo.

Upon a person's data being entered, I need to record saved, BEFORE the PersonContactInfo is saved so the relationships between person and PersonContactInfo will be happy...

Is there a way to control the order if insertion, sans writing vba (which I will do if I need to) that will insert the person (parent) record first, and return the ID, which I'll need to use to insert the child record (contact information which references the parent ID) ?

Thoughts?

Thanks!
 
Just a stab but if you set the relationship up correctly in the tables and the form / subform this should all take care of itself - Unless I'm missing something...
 
are you using a query as the source of the form? If so, I understand why this won't work. Are you using an autonumber as an ID?

You should probably create a button on the form that will automatically add a new record to the parent table and then requery your form before you enter the child information
 
hello,

well, the relationships did manage the insertion order obtaining the autonumbered parent record's pkeyID for use by the child's insertion, which was nice.

So, yea that was auto-magically handled for me... :)

I guess the portion I'll need to manage programmaticly is if the user enters the person's info (parent), then immediately wishes to add multiple contact info records (before saving the parent record) I'll need to confirm that the parent has been added and get back the pkeyID for use in subsequent child records...

Ok, I think I can do this.

Thanks for helping me think fellows! :)
 

Users who are viewing this thread

Back
Top Bottom