By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,263 Members | 2,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,263 IT Pros & Developers. It's quick & easy.

Creating a record for a subform

P: n/a
This is blowing my mind because I thought this setup was working....

How is a new record generated in the table of a Child subform whenever a
new record is generated in the table of the Master form - even though NO
Child field data are entered?

There's no problem if at least one of the Child's subform fields is
entered. But if instead a command button is clicked in the Child's subform
to open yet another form and create records in another table, there's
nothing to link these latter records to a record in the Child's table.

Thanks very much in advance.

LB
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Tue, 11 Jan 2005 22:23:17 -0600, <lo*****@internet.com> wrote:

What I think you're asking is illogical, and therefore Access will not
comply.
You can't add child records to a non-existing parent record. Most of
us consider this a good thing ;-)

-Tom.
This is blowing my mind because I thought this setup was working....

How is a new record generated in the table of a Child subform whenever a
new record is generated in the table of the Master form - even though NO
Child field data are entered?

There's no problem if at least one of the Child's subform fields is
entered. But if instead a command button is clicked in the Child's subform
to open yet another form and create records in another table, there's
nothing to link these latter records to a record in the Child's table.

Thanks very much in advance.

LB


Nov 13 '05 #2

P: n/a
On Tue, 11 Jan 2005 21:46:59 -0700, Tom van Stiphout
<no*************@cox.net> wrote:
On Tue, 11 Jan 2005 22:23:17 -0600, <lo*****@internet.com> wrote:

What I think you're asking is illogical, and therefore Access will not
comply.
You can't add child records to a non-existing parent record. Most of
us consider this a good thing ;-)

-Tom.
Hi Tom,

Sorry I wasn't clear. When I create a new Master record in a form, I want
a corresponding new Child record to be generated in the subform.
Apparently the new Child record is not created automatically until a field
in the subform is updated.

Thanks,

Loren


This is blowing my mind because I thought this setup was working....

How is a new record generated in the table of a Child subform whenever a
new record is generated in the table of the Master form - even though NO
Child field data are entered?

There's no problem if at least one of the Child's subform fields is
entered. But if instead a command button is clicked in the Child's subform
to open yet another form and create records in another table, there's
nothing to link these latter records to a record in the Child's table.

Thanks very much in advance.

LB


Nov 13 '05 #3

P: n/a

lo*****@internet.com wrote:
On Tue, 11 Jan 2005 21:46:59 -0700, Tom van Stiphout
<no*************@cox.net> wrote:
On Tue, 11 Jan 2005 22:23:17 -0600, <lo*****@internet.com> wrote:

What I think you're asking is illogical, and therefore Access will notcomply.
You can't add child records to a non-existing parent record. Most of
us consider this a good thing ;-)

-Tom.
Hi Tom,

Sorry I wasn't clear. When I create a new Master record in a form,

I want a corresponding new Child record to be generated in the subform.
Apparently the new Child record is not created automatically until a field in the subform is updated.

Thanks,

Loren

You would have to use code. and put it in the AfterInsert event of the
parent form. You could open a DAO recordset based on the subform's
datasource and then start adding records... see AddNew in the help.

Nov 13 '05 #4

P: n/a
On 11 Jan 2005 21:43:25 -0800, pi********@hotmail.com wrote:
Sorry I wasn't clear. When I create a new Master record in a form, Iwant
a corresponding new Child record to be generated in the subform.
Apparently the new Child record is not created automatically until a field
in the subform is updated.

Thanks,

Loren

You would have to use code. and put it in the AfterInsert event of the
parent form. You could open a DAO recordset based on the subform's
datasource and then start adding records... see AddNew in the help.


Thanks but that solution is just beyond me. I did look at some online
examples of AddNew and just couldn't get it to work. I'll keep trying.

Meanwhile is there a simpler solution?

Loren
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.