473,763 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel data to a one - to - many relationship

OM
How do I import excel data into 2 joined tables ?

The data is fldDate, fldTruck, fldLitres, fldSpeedometer.

fldDate goes in a table tblFuelHeader, and the rest goes in tblFuelDetail,
with a one to many relationship between tblFuelHeader and tblFuelDetail.

I have a lot of legacy data, and no desire to type it all in.

Any help greatfully received, seized upon, and used immediately.

Rob Lepper
Nov 13 '05 #1
3 4532
Rob,

1. Add fldTruck, fldLitres, fldSpeedometer as new fields in tblFuelHeader
2. Link to the Excel worksheet
3. Create an append query to append fldDate, fldTruck, fldLitres,
fldSpeedometer from the linked Excel table into tblFuelHeader
4. Run the append query
5. Create an append query to append the primary key and fldTruck, fldLitres,
fldSpeedometer from tblFuelHeader into tblFuelDetail
6. Run the append query
7. Open tblFuelHeader in design view and delete the fields fldTruck,
fldLitres, fldSpeedometer

You're doing it this way so that you get a foreign key for each appended record
of fldTruck, fldLitres, fldSpeedometer that matches the primary key for each
fldDate record appended to tblFuelHeader

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

"OM" <le******@loxin fo.dot.co.th> wrote in message
news:c9******** **@news.loxinfo .co.th...
How do I import excel data into 2 joined tables ?

The data is fldDate, fldTruck, fldLitres, fldSpeedometer.

fldDate goes in a table tblFuelHeader, and the rest goes in tblFuelDetail,
with a one to many relationship between tblFuelHeader and tblFuelDetail.

I have a lot of legacy data, and no desire to type it all in.

Any help greatfully received, seized upon, and used immediately.

Rob Lepper

Nov 13 '05 #2
OM
Thank you thank you thank you !

Rob Lepper
"PC Datasheet" <No****@Nospam. Spam> wrote in message
news:oM******** *********@newsr ead3.news.atl.e arthlink.net...
Rob,

1. Add fldTruck, fldLitres, fldSpeedometer as new fields in tblFuelHeader 2. Link to the Excel worksheet
3. Create an append query to append fldDate, fldTruck, fldLitres,
fldSpeedometer from the linked Excel table into tblFuelHeader
4. Run the append query
5. Create an append query to append the primary key and fldTruck, fldLitres, fldSpeedometer from tblFuelHeader into tblFuelDetail
6. Run the append query
7. Open tblFuelHeader in design view and delete the fields fldTruck,
fldLitres, fldSpeedometer

You're doing it this way so that you get a foreign key for each appended record of fldTruck, fldLitres, fldSpeedometer that matches the primary key for each fldDate record appended to tblFuelHeader

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

"OM" <le******@loxin fo.dot.co.th> wrote in message
news:c9******** **@news.loxinfo .co.th...
How do I import excel data into 2 joined tables ?

The data is fldDate, fldTruck, fldLitres, fldSpeedometer.

fldDate goes in a table tblFuelHeader, and the rest goes in tblFuelDetail, with a one to many relationship between tblFuelHeader and tblFuelDetail.

I have a lot of legacy data, and no desire to type it all in.

Any help greatfully received, seized upon, and used immediately.

Rob Lepper


Nov 13 '05 #3
OM
I've done this, and it works (of course), but it puts one new record in
tblFuelHeader for every new record in tblFuelDetail.

The way that tblFuelHeader works, is that there is ONE date record, and the
primary key is used in tblFuelDetail, and refers to many records that were
entered on that date.

For instance, there may be 5000 individual FuelDetails (fuel fills) in a
month, but only 31 days. This should mean that tblFuelHeader would have 31
new records, and tblFuelDetail would have 5000.

The way below has added 5000 records to both tables.

Any solutions ? Please ?

Rob Lepper

"PC Datasheet" <No****@Nospam. Spam> wrote in message
news:oM******** *********@newsr ead3.news.atl.e arthlink.net...
Rob,

1. Add fldTruck, fldLitres, fldSpeedometer as new fields in tblFuelHeader 2. Link to the Excel worksheet
3. Create an append query to append fldDate, fldTruck, fldLitres,
fldSpeedometer from the linked Excel table into tblFuelHeader
4. Run the append query
5. Create an append query to append the primary key and fldTruck, fldLitres, fldSpeedometer from tblFuelHeader into tblFuelDetail
6. Run the append query
7. Open tblFuelHeader in design view and delete the fields fldTruck,
fldLitres, fldSpeedometer

You're doing it this way so that you get a foreign key for each appended record of fldTruck, fldLitres, fldSpeedometer that matches the primary key for each fldDate record appended to tblFuelHeader

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

"OM" <le******@loxin fo.dot.co.th> wrote in message
news:c9******** **@news.loxinfo .co.th...
How do I import excel data into 2 joined tables ?

The data is fldDate, fldTruck, fldLitres, fldSpeedometer.

fldDate goes in a table tblFuelHeader, and the rest goes in tblFuelDetail, with a one to many relationship between tblFuelHeader and tblFuelDetail.

I have a lot of legacy data, and no desire to type it all in.

Any help greatfully received, seized upon, and used immediately.

Rob Lepper


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
15512
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access wizard..... If I have to write vb code, where is a sample??? Or do I import the excel in to a new spreadsheet and then write some kind of querey to move the data from that table
0
1270
by: WindAndWaves | last post by:
Dear Gurus I am trying to export some data to excel from a form, but I seem to run into difficulties when the user has filtered for particular data that is from a dropdown (linking to another table in a one to many relationship). The W (filter for the form) that caused the error was WHERE (((.DD="New York"))) AND ((.DD="X"))
2
6683
by: Jen | last post by:
Trying to take one table in access and split it into multiple excel files(using an excel template); and then email based on email addresses in Table2; Of course, I would like to do all of this with minimum user-interface...If there is anyone out there that can help... please feel free to share!:) PS... Using MSOffice 2000 Example: Table1
6
2327
by: Paul Wagstaff | last post by:
Happy new year...hope someone can help with this.. The nub of this problem is to populate 2 tables in a 1-M relationship from an imported Excel spreadsheet. The problem being that there is nothing within the data that can uniquely identify a record. My mdb has 3 tables: tblImport (ID, CustName, Owner1, Process1, Owner2, Process2) tblComplaints (PK_Complaint_ID, CustName)
1
2147
by: Jim Heavey | last post by:
Hello, I am using a generic AD Domain Account to create an excel spreadsheet, but I am getting an "Access Denied" error when I attempt to instatiate the excel object. The generic account does is set up in such a way that I can not log on to the server with the account but it is a valid account as I have used it in other applications. The code works perfectly fine when I use my own account ID and password. So there is something about...
15
2436
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums that are formatted for number and then half way down they are changed to text. OR the famous ok now everything in red is ---- and everything in blue is---------. WTF are these people thinking?
5
6780
by: aamax | last post by:
I have to read data from an excel spreadsheet. the first column has a variable number of rows that are associated with one value (which is in only one of the rows, and it's variable about which one). In excel the rows of column 1 are outlined by a nice border and it's easy to see that this particular value corresponds to the 1..n rows in the following columns. It's basically a 1 to many relationship across the spreadsheet. how can I read...
0
1620
by: Shootah | last post by:
Hi, I have succeeded in adding automated relationships with refference tables after importing an excel file created from a query to an Access database. However I have the following problem: When there are values in the excel file which was imported that do not appear in the refference tables because they are not entered yet, or in case they are misspelled, the code blocks and gives me an error message. As I am not that much of a coding...
1
1519
by: }{ | last post by:
Guys, I have a database that basically logs service calls. The calls table has entries for call no among other things. This call number field has a one to many relationship with another table (Parts). When filling in the details, it isn't a problem, I simply click the small plus sign next to the call and enter parts used in the parts table, this way, these specific parts are associated with this call.
0
9383
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9992
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9935
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8821
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5268
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3916
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
3
3519
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.