473,396 Members | 1,893 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,396 software developers and data experts.

How to insert a record set into multiple the parent table and child table in a one to many relation

Hi evryone,
i am sure you have probably had this questions several times. I am new to Access, so please bear with me.
i have data on an excel sheet imported into my access database. and this data needs to be inserted into two tables. The parent table is linked to the Child table with the help of a primary key in a one to many relation. i can insert the data i need into the Parent table but i get stuck at the second level , that is, the data which need to go into the child table does not do that.

I am trying to SQL with the INSERT INTO, but i am not sure I am writing it correctly.
Someone suggested using VBA to do this, but as I said, I am new.

can any one help me out her. show me how to start?
thanks alot
Jul 6 '21 #1
1 2351
NeoPa
32,556 Expert Mod 16PB
Hi Veronica.

Welcome to Bytes.com.

Please understand, no matter how much we'd like to help, telling you where you've gone wrong is always going to be difficult until you share what it is you're doing.

When populating data into a Child table it is often first necessary to populate the Parent table. Have you done this successfully first? If not then you'll struggle but your post indicates that you probably have.

What data are you working with? Example data is fine.

What have you tried that isn't working? It's far easier to explain something that you can understand if we start with something you know. If you have some SQL that's close and just needs a small change that's so much easier for you to understand than writing it from scratch.

From what you've written so far I assume you're working in SQL but using QueryDef (Saved Query) objects. That's fine but if not correct we absolutely need to know.
Jul 6 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Caroline | last post by:
I seem to always want to do this type of join, but I can never find how to do this. I am trying to join two tables. The parent table will always have one row of data and the child may have 0 to...
3
by: vishnu mahendra | last post by:
I have two table both say A and B. If i insert a record in A that record should be inserted in B. If i delete a record in A that record should be deleted from B. Is that possible.If yes please...
10
by: jaYPee | last post by:
as of now i am using a stored procedure from my sql server 2000 to insert record from another table. what i need now is on how can i insert record by not using the stored procedure and insert it...
3
by: PAUL | last post by:
Hello, I have 2 datasets I am trying to update. The parent table seems to update fine but when I go update the chiled table I get an error message that says I need a related record in the parent...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
1
by: swatijogdand | last post by:
Hi all, I want to insert a record at a time from front end i.e. vba in a table located on sql server. But, one field on that table has an 'identity' constraint which is not enabling me to insert...
3
by: Rohullah | last post by:
I want to insert record into two table at a time. For example i have two table student1 and student2 with the same structure now i want to insert record into student1 the record of student1 should...
10
by: Begood | last post by:
http://s3.postimg.org/k7aq1v1tf/Captureddd.png I want to write a Stored Procedure for these 2 tables , I have this SP but it doesn't achieve my point.. CREATE proc . @prdctName...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.