473,320 Members | 1,856 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.

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 4506
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******@pcdatasheet.com
www.pcdatasheet.com

"OM" <le******@loxinfo.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*****************@newsread3.news.atl.earthl ink.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******@pcdatasheet.com
www.pcdatasheet.com

"OM" <le******@loxinfo.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*****************@newsread3.news.atl.earthl ink.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******@pcdatasheet.com
www.pcdatasheet.com

"OM" <le******@loxinfo.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
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...
0
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...
2
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...
6
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...
1
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...
15
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...
5
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...
0
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: ...
1
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...
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
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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

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.