473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6494
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.comwrot e:
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
1579
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 share some tables for read-only lookup purposes. All users(about 24) work in the main db, as well as in the small db's related to their particular jobs. Here are the pros and cons as I see them now. Pros:
1
1420
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
4533
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 a database. heres the scenario or process that I am facing 1. A total of 3 text files are generated from the mainframe and save to a secure network share. In each text file only raw data
6
1885
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 problems for data corruption? Thanks. (All tables are exactly identical, its the same DB copied seveal times, each has different records entered that need ot be comboned.) thanks.
2
2595
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 ( , , (255), ,
4
1434
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 form but it doesn't allow me to add a new record. The "new record" selection at the bottom of the form is not selectable. I tried creating a add new record button but that was a no go also. Anyone have any suggestions? Thanks OS:Vista...
3
1649
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 my results be in in the table below called "TBL_Compiled". Any help is appreciated, and thanks! TBL_Start_1: ID, Resource_Name, Start_Date, End_Date 1111, John Smith, 4/11/2007, <blank> 1112, Susan Doe, 5/25/2007, <blank> TBL_End_1:
1
3418
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 below. My problem is if I don’t use the WHERE clause in my script below, the script can query up to 3 records with the same “LoanNo” due to the fact that there can be up to 3 “TypeCodes” in each Table (Borrower, Co-Borrower 1 and Co-Borrower 2...
3
2844
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 dataset to data in a second dataset, using a common key. I will first describe the problem in words and then I will show my code, which has most of the solution done already. I have built an ASP.NET that queries an Index Server and returns a...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
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...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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
5381
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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.