473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2096
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bruno Luis | last post by:
Hello I'm using A97 and i'm having some trouble with creating a recordset with data from two different databases. I connect to a remote database and make this data the default source for my...
1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
5
by: Bob | last post by:
Hi Everybody I have a form called frmListBox that is connected to a table tblListBox. This is opened from a form called "frmInvoiceOrder" which has a subform called "zfrmInvoiceOrder" and...
1
by: Trent | last post by:
I am in the design phase of a new database and am having a devil of a time with a subform. I have three tables that relate to problem - Suppliers tbl, Customers tbl and a SuppliersCustomers tbl....
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
7
by: ppywong | last post by:
Hi, hopefully people can help: I am creating a rather simple database for a kids holiday camp. I have two main tables: tblLData (Leaders info) and tblKData (kids info). What I have done is...
4
by: aflat362 | last post by:
If you look at this page on relational database design: http://r937.com/relational.html And scroll down to the "Many-to-Many Relationships" Section you will see a common database structure. ...
5
by: Don Do | last post by:
Ok, this is my 2nd ever post. 1st one was solved quickly. Thanks. Now I'm stuck again. My mdb has a main form with 3 subforms. Each tied to the succeeding by single autonumberID/foreign...
2
by: adwest | last post by:
Forgive me if this is a foolish question. I "play" in Access and have only created a few rather simple relational databases. My knowledge and experience is limited. I have no formal training, just...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.