473,554 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2111
On Tue, 11 Jan 2005 22:23:17 -0600, <lo*****@intern et.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*****@intern et.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*****@interne t.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*****@intern et.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********@hotm ail.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
3900
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 continuous form (Set me.recordset = rs). The problem is: one of the fields of the remote database is a foreign key (two digit number), and the table...
1
680
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 the mainform) 2. To add new issues, a button is used and a pop-up form is used to add an issue with more detail than what's available on the...
5
3362
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 floats above (ie is pop-up) ! Private Sub ListBox_DblClick(Cancel As Integer) DoCmd.OpenForm "Forms!!!.Form! = Me!ListBox.Column(1) Forms!!.Form! =...
1
2199
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. The intent is to have the user enter in spend information by customer with each supplier. Sounds simple enough right? The common fields in each...
12
12913
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 we prevent this from happening? Thanks. ming
7
6750
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 using a Query, combined two fields of the each table into one (Year Group & Group into GroupName). Using these fields, I have made a form for the...
4
3473
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. I can not find a simple way to create forms and reports in Access that allow you to enter and display data in a structure such as this.
5
2078
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 fields. Each of the subforms is in continuous form format. The forms seems to work well as far as viewing or adding records in each of the subforms,...
2
2310
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 picked up a few books and have gone from there... I'm not sure how to relate my question using the accepted shorthand, so I'm afraid this will be a...
0
7535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7812
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7574
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7894
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3579
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2026
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1145
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.