469,282 Members | 1,715 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Creating a record for a subform

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
4 1892
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
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

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
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.

Similar topics

1 post views Thread by sixsoccer | last post: by
1 post views Thread by Trent | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.