DataBase - Combining Tables

Asked By scottydont2121
20-Nov-09 01:17 PM
Hello,

I have 5 files in excel.  These files will have the same fields, but the
information will change in them every week.  I am then going to import the
the excel files into access into my five tables that I have created.  What I
need is from all those 5 five tables to be combined into one big table.  I
want to keep all the same fields, just a combination of the five.

I have to do some modifications on that on that huge file.  But my main
concern is how to combine all that data into one huge file.

Thanks
Excel
(1)
Database
(1)
Spreadsheets
(1)
Doonttyou
(1)
Doontt
(1)
Week
(1)
  Jeff Boyce replied to scottydont2121
20-Nov-09 02:45 PM
It sounds as though you are expecting Access to be Excel ("same fields... 5
files in Excel ... five tables ...").

Access is a relational database, not a spreadsheet.

You are (probably) correct in looking to put all the data in one table (but
I cannot tell for sure, because I cannot tell what data you are talking about).
Here is one approach to doing that:

* link to each of the spreadsheets
* create a query against each of the links
* create a table to hold the full set of data
* if the 'source' is important data, modify each query to include a value
that mentions its source
* convert the queries to "Append" queries, appending to the new table

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
  KARL DEWEY replied to scottydont2121
20-Nov-09 03:08 PM
No need for five tables.  Use one and add a field to identify the date of
import.
Append the new data each week using Date() as the input for import week.
--
Build a little, test a little.
  scottydont2121 replied to KARL DEWEY
20-Nov-09 03:36 PM
Hey ,

The files are coming from 5 different places.  I mean i guess I could copy
and past them in excel, but that may get messy.  I just wanted to have some
sort of automated query, where I could put the info into each of teh tables
in access and then do some sort of query where I can combine all the
information.  Because after I get the huge table I have to run a make table
query to format and sort out the data that i need extracted.  I think my best
bet is the append query, but i am fairly new to access an do not know much
about it.

Thanks for you help by the way.
  sweetummy replied to scottydont2121
22-Nov-09 05:14 AM
Hi scotty doontt

you can import all the data to ms access by importing option which you
find in tables..
click on the tables then right click on the white space to import data
from excel. a small wizard will help us to import the data..

after importing all 5 files in access.. open the first table and copy
whole and paste all in 1 table you desired then process is over..

now you can query to get the results..

bye..
Create New Account
help
Library Database DataBase Firstly, I am not sure if Library database is the correct term. I am talking about Dbs to which you set a reference drew blanks last time. Now assuming I have several referenced (library?) databases in my main database, how do I get the names of all the forms in all the Dbs? CodeProject AllForms.Count gives me the correct number of forms if I am in that referenced database. What I think I need is a method of looping through all the different CodeProject names in the main database, but there is not a sort of CodeProjects parent object. Or somehow moving the focus And, No, there is not any parent object for all the code projects. Because each database only knows about its own objects (or documents), you have to use a procedure in each database to refer to the objects in that database. E.g. to open a form in
Might be outgrowing Access but daunted by SQL Server DataBase I am close to completing the consolidation of various small Access databases and a couple of Excel spreadsheets that my little company uses (5 staff) into an all encompasing Access database and I was planning on splitting the database when I was finished to allow simaltaneous use of it by staff on our small to me that I am going to need to give staff access to this new database from remote locations (outside of our office network). Two staff members are regularly overseas, one been playing around with trying to link tables from remote locations (ftp path of the database on our Network Storage Device at the office) and needless to say - that do not It all started when I came across a very encouraging article on keeping your Access database as your front end application and linking to SQL Server database tables. I am finding
Exporting Report from Access into PDF DataBase Hi everybody. I am hoping someone may be able to help me out. I have a database report that I want to export into PDF for each individual customer. Basically, I want code from Ken Snell that worked great for looping through customer numbers and exporting an excel file for each individual customer. I tried to do a bit of modification to this time this source data changes. I am trying to work with Stephen Leban's A2000ReportToPDF database right now, but it is far more advanced than my puny range of code knowledge I am working with right now: Dim qdf As DAO.QueryDef Dim dbs As DAO.Database Dim rstMgr As DAO.Recordset, rstMgr1 As DAO.Recordset Dim strSQL As String, strTemp As Close strTemp = strQName ' * ** code to set strSQL needs to be changed to conform to your ' * ** database design - - ManagerID and EmployeesTable need to ' * ** be changed to your table and field names ' Get rstMgr.EOF = False ' * ** code to set strMgr needs to be changed to conform to your ' * ** database design - - ManagerNameField, ManagersTable, and ' * ** ManagerID need to be changed to your table and field names Acct#", "Customers_To_Email", _ ' * ** code to set strSQL needs to be changed to conform to your ' * ** database design - - ManagerID and EmployeesTable need to ' * ** be changed to your table and field names strSQL
Writting ACCESS table to Excel DataBase I am trying to write to Excel and have this code. . which fails at line Dim Rst1 As New ADODB.Recordset, saying Dim DXrptPath As String DXrptPath = "r: \ temp \ Resultsreportingworksheet.xls" '* **Opening Report Template Dim myDB As Database Set myDB = CurrentDb Set ExcelWindow = CreateObject("excel.application") ExcelWindow.Visible = True ExcelWindow.Workbooks.Open (DXrptPath) Dim DXrpt As Workbook Set DXrpt = ActiveWorkbook Access Forms Coding Discussions ADODB.Connection (1) DXrpt.Application.WindowState (1) ADODB.Recordset (1) Microsoft Excel (1) ObjRNG1.CopyFromRecordset (1) ObjRNG.CopyFromRecordset (1) Excel (1) ObjRNG1.NumberFormat (1) hi, This indicates that you have not a reference to the Here is how (copy and paste the following code into a new module): Option Compare Database Option Explicit ' This module requires the following references: ' ' 1. Microsoft DAO Object Library ' 2. Microsoft
Format Excel Sheet after DoCmd.TransferSpreadsheet DataBase I have read through several of the topics on this subject and still do not runs ok and other times I get odd errors. . . = = = = = = = = = = = 'Run the selected query out to excel. . . DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, RunQry, fn, True 'Format the spreadsheet Dim xlApp As Object Dim As Object Dim FlNm As String 'Just the name of the file. Set xlApp = CreateObject("Excel.Application") xlApp.Visible = False Set xlWkb = xlApp.Workbooks.Open(fn) ' "fn" is the name with Set xlWkb = Nothing xlApp.Quit Set xlApp = Nothing = = = = = = = = = = I was also having trouble getting the excel application to close all the way. You can see it if you look in the ActiveWindow.FreezePanes (1) DoCmd.TransferSpreadsheet (1) ActiveWindow.FreezePanes (1) ActiveCell.SpecialCells (1) DoCmd.OpenQuery (1) Excel (1) You do not say what the random errors are, so it is a bit in the code they might be generated. However, I see that you are using the EXCEL intrinsic constant xlLastCell, which has NO meaning in your ACCESS VBA code because you are using late binding for EXCEL. The actual value of xlLastCell is 11, so replace the xlLastCell with the number 11