472,805 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 4479
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.