473,507 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Appending data to multiple Tables in Access 2003

3 New Member
I would like to be able to append data from multiple tables into a single summary table using either an event procedure for the On Load or On Open properties on a form, but cannot seem to figure this out. Is it possible to do this using a macro or event procdedure in Access 2003?

I tried both but cannot seem to get either to work.

Please help...

Thanks!
Oct 15 '07 #1
5 3189
Scott Price
1,384 Recognized Expert Top Contributor
Generally speaking you would use an Append query to do this. The general syntax is:
Expand|Select|Wrap|Line Numbers
  1. Insert Into [Destination Table]
  2. Select [Select Criteria]
  3. From [Source Table(s)]
  4. Where [Where Criteria]
Note that this is just like a regular select query, with the exception of the Insert Into clause.

Welcome to the Scripts!

Regards,
Scott
Oct 15 '07 #2
Kimg0123
3 New Member
OK, I am not sure how to do this... I have 22 tables that are exactly the same except for one column, which indicates the AlphaCategory of the data being entered for that table. I need to append data from all of these tables into a summary table that will combine all data. I also need two fields combined (AlphaCategory and Unique ID) from each of the individual tables to create a File_ID for each record, and I have set the criteria for each table to not append the records if the "original file name" is null.

I created two append queries, the first to append the first 11 tables and the next to append the next 11 of the 22 tables. When I ran them, I get the following error: "Duplicate output destination 'alphacategory'" [the alphacategory is in each of the tables and identifies the data type for the group of records in that table]. I think that I would most likely get this error for each of the columns I am trying to append.

I'd have also created individual append queries for each of hte tables and would like to run an event procedure or a macro that would run them right after each other in sequence to get them appended. Is this a possible workaround or is there something else that I can try?

-------------------------------------------------------------------------------------------------------------------
Oct 15 '07 #3
Scott Price
1,384 Recognized Expert Top Contributor
Why 22 tables exactly the same?

The essential concept of a Relational Data Base Management System (of which Access is just one) is that you only store ONE piece of information in ONE place.

If you are locked into have the database structure non-normalised, you could explore using a Union query first to group the data, then run the Append query.

Have a look, though, at these tutorials: Database Normalisation and Table Structures and Basis SQL Syntax for Access queries

Regards,
Scott
Oct 15 '07 #4
Kimg0123
3 New Member
Well, I created this db on the fly and needed to ensure that the data types were managed separately... each of the separate data types needed to have a unique ID that is specific to the data type... The data types are alphacategories that go from A to V; each one represents a different type of stored data and we need to track the same information for each of hte data types, thus the need for the same data in each of the tables A through V except the alphacategory.

The goal is to have the alphacategories, A for instance, enumerate each record consecutively then have the same thing happen for each of the other alphacategories/data types. So, if we had 500 records for category A - they would be numbered sequentially like this A10001 to A10500, and 300 records in category B, they would be numbered in the same fashion, i.e. B10001 to B10300. Thus, each data type A-V will have its own group of unique alphanumerics assigned to it.

I din't come up with the idea, only the solution to data entry to accomplish this goal in naming convention for each of the data types. Do you have any other suggestions on how to do this?

---




Why 22 tables exactly the same?

The essential concept of a Relational Data Base Management System (of which Access is just one) is that you only store ONE piece of information in ONE place.

If you are locked into have the database structure non-normalised, you could explore using a Union query first to group the data, then run the Append query.

Have a look, though, at these tutorials: Database Normalisation and Table Structures and Basis SQL Syntax for Access queries

Regards,
Scott
Oct 15 '07 #5
Scott Price
1,384 Recognized Expert Top Contributor
How about posting for me the meta data of one of your tables, I'll be better able to give a suggestion after seeing this.

Here is an example of how to post table MetaData :
Table Name=tblStudent
Expand|Select|Wrap|Line Numbers
  1.       Field; Type; IndexInfo
  2.       StudentID; AutoNumber; PK
  3.       Family; String; FK
  4.       Name; String
  5.       University; String; FK
  6.       Mark; Numeric
  7.       LastAttendance; Date/Time
Regards,
Scott
Oct 15 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4324
by: | last post by:
I have an ACCESS db from a DEXA machine (bone scanner). The data is in seperate tables and I want to link them so that I can query and create one table with all the data I need from the seperate...
3
1875
by: Ron Nolan | last post by:
I have a large application that contains lots and lots of financial history data. The history data is currently set up in a table called 'TblHist' that exists inside each of these three .mdb...
1
1788
by: Eli Sidwell | last post by:
I have an Access DB that contains 5 tables for the last 5 years. All 5 tables have the same structure. I wanted to keep each year separate for organizational purposes. But, I want to query all 5...
5
1946
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can...
0
1532
by: HydroPnik | last post by:
Hi all! What a great community you have here. Being an Access newbie I have already used much information gleaned from the other posters for my current project. I have been tasked with creating a...
9
3991
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
8
1718
by: Lykins | last post by:
We currently use Access 2003 in our company and have had this issues from every version from Access 97 to 2003. We deal with large databases and run a lot of queries over tables with millions of...
13
4818
by: BrokenMachine | last post by:
Hi there, I'm using Access 2003 and Word 2003 and I'm trying to import data from the word form to multiple access tables in a one to many relationship, but I can't seem to figure it out. I have...
3
1665
by: HSXWillH | last post by:
I've looked through the site and not found what I'm looking for here. I am not code-versed or anything like that so my skills are rudimentary at best. I'm using Access 03 on a Windows Vista...
0
7223
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
7110
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
7314
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,...
0
7482
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...
0
5623
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,...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
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 ...
0
411
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...

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.