473,396 Members | 1,755 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.

Combining several tables in MS Access 2007

I work for a school district, and I have just imported 6 Excel
worksheets into Access 2007. Now I have 6 different tables. In each
table all the fields are the same. I need the easiest way to merge
all the tables into one huge table. There are at least 2,500 records
per table if that makes a difference.

I am unfamilar with writing any type of code, so please don't suggest
that unless you can also tell me how to do that.

Thanks
Mar 26 '08 #1
3 6471
On Mar 26, 10:23*am, masonic35and7 <masonic35a...@gmail.comwrote:
I work for a school district, and I have just imported 6 Excel
worksheets into Access 2007. *Now I have 6 different tables. *In each
table all the fields are the same. *I need the easiest way to merge
all the tables into one huge table. *There are at least 2,500 records
per table if that makes a difference.
1) Make a new empty table or choose the existing table to be the
central repository of the data.

2) Make a query for all field and records for the first table. Change
the query type to Append and select the destination table as the
target.

3) Execute the query

4) Delete the source table and replace with the next

5) Lather, rinse, repeat until all source tables have been used.

Good luck

Tim Mills-Groninger

Mar 26 '08 #2
On Mar 26, 9:17*am, timmg <tmillsgronin...@gmail.comwrote:
On Mar 26, 10:23*am, masonic35and7 <masonic35a...@gmail.comwrote:
I work for a school district, and I have just imported 6 Excel
worksheets into Access 2007. *Now I have 6 different tables. *In each
table all the fields are the same. *I need the easiest way to merge
all the tables into one huge table. *There are at least 2,500 records
per table if that makes a difference.

1) Make a new empty table or choose the existing table to be the
central repository of the data.

2) Make a query for all field and records for the first table. *Change
the query type to Append and select the destination table as the
target.

3) Execute the query

4) Delete the source table and replace with the next

5) Lather, rinse, repeat until all source tables have been used.

Good luck

Tim Mills-Groninger
Tim,
I did as you instructed. I have run into a hurdle. I created a new
empty table, and I selected that as my "Append to" destination. I
click on OK, then I hit run, and it gave me the error message that I
need at least one destination field. What do I do??
Mar 26 '08 #3
Greetings,

Instead of using queries, lets try a simple code module. First, I
understand you imported 6 excel worksheets. They will be named
something like Sheet1, Sheet2, Sheet3,...

So you have created an empty table that contains the same number of
fields as each of the Sheet tables. If you did not create a table
exactly like the sheet tables -- what you can do is to just copy any one
of the sheet tables and choose only structure but not data. For my
explanation I will call the new table table1.

Now go to the Code Module tab and create a new code module and save it.
It will be saved as module11 I believe, by default. Now copy the
following code from here and paste it into your code module and rename
the sheet tables as necessary.

'--copy this code
Sub AppendData()
DoCmd.RunSql "Insert Into table1 Select * from Sheet1"
DoCmd.RunSql "Insert Into table1 Select * from Sheet2"
DoCmd.RunSql "Insert Into table1 Select * from Sheet3"
DoCmd.RunSql "Insert Into table1 Select * from Sheet4"
DoCmd.RunSql "Insert Into table1 Select * from Sheet5"
DoCmd.RunSql "Insert Into table1 Select * from Sheet6"
End Sub

Now place the mouse cursor anywhere inside

Sub AppendData()

and press the F5 key and all the data from each of the sheet tables will
be appended to table1.

Note: each of the sheet tables must be exactly alike for this to work.
They must all have the exact same number of fields.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Mar 26 '08 #4

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

Similar topics

0
by: Bob C. | last post by:
I am considering combining one large Access db and several small Access db's into a single SQL Server 2000 db. The small db's serve separate but related functions in our operation, and they all...
1
by: Reidar Jorgensen | last post by:
I have several databases, identical in structure but with different data. Is there an esay way to combine all the data into one big database? There are six tables.
3
by: Odawg | last post by:
Hello All Database (Access) Guru's, I am a novice when it comes to databases and I know enough to get simple information for my needs. With that said, I was given an opportunity for improvement...
6
by: robertmeyer1 | last post by:
Hi, There are several databases that have the same tables, with different reocrds. I need to be able to combine them all into 1 in an easy manner/best. How can I do this and are there potential...
2
by: rdraider | last post by:
Using SQL 2000, how can you combine multiple records into 1? The source data is varchar(255), the destination will be text. I need help with the select statement. example tables: CREATE TABLE ...
4
by: wideasleep | last post by:
Hello, I have a situation where I have been asked to combine two tables and make a form to continue to enter data. I have created a relationship between the tables and have gotten to creating the...
3
by: cjbutler | last post by:
Hi, I am using MS Access 2003 on a Windows XP platform. I am wondering what the best way is to go about combining data from 4 tables. Here is a sample from all 4 tables, with what I would like...
1
by: bluereign | last post by:
Thank you for your assistance. I am a novice looking to JOIN and append or combine records from 2 current Tables into 2 new Tables named below. I have been able to JOIN Tables with the script...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
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...
0
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,...

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.