General :: Importing Data To A Table And Appending To Another Table
Aug 24, 2014
I have to import a file from an external website into a table (tableA) that I have established. The issue is that I don't need all that data, just specific ones (the website does not allow me to select the specific data to export). I created another table (tableB) to capture the data that I require for my report.
How do I take raw data from tableA to append to tableB the required fields that I want?
importing data from two excel sources to one table. I have a table with: Unit, Info1, info2, info3, info4, info5, info6, info7. I have been able to import from the first file which has all of the unit information-'info1-5'. I need to import another file to fill 'info6-7' based on specific unit numbers. I have created two excel tables the first with the headers "unit, info1-5" and the second with the headers "unit, info6-7." The first works fine and adds all the data I want it to, but when I try to do the same with the second it doesn't add any new data.I cannot add the last two fields to my first spread sheet because it would involve sorting through 700+ units and adding the data manually to 400+ of them.
I am developing a database for incoming inspection. I have set up two tables, one with spec callouts per product and the other table contains fields where I want the specs from the tblSpec table to be Append into the tblMeasurement table. Now, within the tblMeasurement table (where I am trying to append specs from the tblSpecs table into), I also have additional fields for actual measurements from received goods.
My plan is as I go through and select the Vendor, it populates the associated products to that vendor (no problem there). When I want to select the product, I would like the specs from the tblSpecs to dumped into the tblmeasurement table that correlates to that product on the form.
How can I have this automatically append after selecting the product? I am not sure if I have my relationships set up correctly or not, but I cannot see to append when I am trying to execute this function while in Query view. I have the db attached in a zipped format.
I am assisting my employer by combining two databases into one. Both databases have the same field "structure" but the data differs. When creating my append query.
I'm fairly new to Access, but have set up a database containing 8 normalized tables. I would like to know if it's possible to update all those tables by importing an Excel file into each table, or importing the Excel file into one Access table and then appending that table to those 8 tables. AND STILL MAINTAIN THE RELATIONSHIPS. The Help directory only talks about importing or appending into one table.
I want to import an Excel spreadsheet into a table in my Access DB. I am using following: DoCmd.TransferSpreadsheet acImport, 0, "tblSchedule", "C:mailinimport.xls", false This code works but it is appending to the table. What is the best way to update the table - or would it be best to delete the old table and then to create a new one to import tha data into? If the latter would be most elegant solution, can anyone help with some code that would do this ? Thanks Mat
I have a linked ODBC table in my database that contains data like this -
Code: Task Serial CrewAmount 00_INSTALL ENGINE INTO PEDESTAL STAND 707308AS30.2 00_INSTALL ENGINE INTO PEDESTAL STAND 707308OMB0.2 01_BORESCOPE INSPECTION 706496AS114.24 01_BORESCOPE INSPECTION 706496AS223.24
[Code] .....
What I would like to do is remove the duplicate values for the Task field, but show how much time each Crew has spent on each Task per Serial. The end result would look like this -
Code: Task SerialAS1AS2AS3OMAOMB 01_BORESCOPE INSPECTION 70649614.2423.2428.78 00_INSTALL ENGINE INTO PEDESTAL STAND 7073080.20.2 01_INSTALL OIL TANK 7073085.67
[Code] ....
What is the best way to achieve this result? I've played around with Append queries, union queries etc, but nothing seems to give me the result I'm after.
I have a table in MS Access 2010 that is a link to an external data file in .csv format. I assumed that it was not possible to append data to a linked table until recently. I appended 3 records to the linked table and discovered that the 3 records were appended to the table and the external data file it was linked to.
After appending data in a table, I open a particular form. I want to display only the last record. I've added the code (DoCmd.GoToRecord , , acLast) to the On Load and On Open properties without success (opens first record).
I currently have an unnormalized table that consists of individuals (employee profiles) which currently has a field for attachments. I am using the "attachments" for photographs of each employee however I dont want to maintain photographs for former employees, or if I do not forever. I was told to normalize the table by removing the "attachment" field and placing it in a new table with referene to the employeeID.
Since I currently have something like 200+ records where I want to relocate the employee picture, i tried to create a make table query off the origional table and only referencing the employeeid and "attachment" to the new table however I keep getting an error when running the query. The error indicates something to the affect of having multiple values.
I'd like to be able to filter through a .dat file like that (which is pretty much just like a .txt file as far as I can tell) and have that data appended into a table by way of a command button.
The annoying thing is that the data would have to be pulled out of the .dat file by position into columns like this:
Example line:
Code: 09 19192 00010212b1 5010570223 19192 = Ticket (Will be 5 digits long) 0001 = Quantity (Should be 4 digits long) 0212b1 - Location (Will be 6 characters long) 5010570223 = Article (Will be 10 characters long (not numbers))
by the way, let's say the .dat file will be in folder C:CENTURYWTERM.
Function SyncSuppliers() On Error GoTo errhandle Filename = DLookup("SupplierPath", "Setup", "SetupActive = True") If Filename = "" Then Exit Function End If Set xlapp = CreateObject("Excel.Application")
[code]....
The 5th row is where the problem is abbot and co will import n stop missing out the brackets (I need all the data). same for the last row A-BELCO LTD will import (HADAR LIGHTING) does not.
I'm looking to import huge excel sheets in access, but normalization process in Access has forced me to divide all the columns in Excel to about 12 tables in MS Access.
How how could I import data from excel sheet columns to 12 different tables?
what is the best way to import the data from the XML file into an access database table. The database I am working with has one large main table where all of the main record data is stored. There is a somewhat complex string of queries and reports based off this table that I am concerned about preserving. The problem is that the XML file is not structured in the same way the table is. The headings are named different, aren't in the same order, etc. I cannot use the import method and simply append it to the main table.After much searching around I have found two options:
1) Use the built in XML import method that access provides to create a secondary table. Then find a way to take data from individual fields in the second table and map and insert it into a new record in the main table.I already have the import part of this option working. The only part I can't seem to understand is how to take data from the second table and get it into a new record in the main table under the correct headings
2) Read the data from the XML file all at once and then map and insert it into the main table.I have not attempted this yet. I was having a hard time understanding how to retrieve the data from the XML file in the first place.
So.. which would be better/easiest to automate (most likely via button click on a form)? I only have a small understanding of VBA and even less understanding of anything XML.
Code beneath worked perfectly with Access 2003.Now we switched to Access 2010 and it generates a table where data isn't put into my 77 fields like before, but seperated into 1 field, separated by some ;;;.I am not good with programming.
Dim rst_data As Recordset Dim oldname As String, newname As String DoCmd.DeleteObject acTable, "TBL_import_TPXP_Radi_Evvd" DoCmd.TransferText acImportDelim, , "TBL_import_TPXP_Radi_Evvd", "N:APPLSHAREPRDQSIGMKTDISTPWBUSPB1815RADIEV IMPACT.CSV", False, ""
I work at a hospital and I have been able to copy and paste data from a patient list into an Excel spreadsheet into a list I can customize to track patients I work with. I had a macro that would take the data copied and pasted and organize it in the way I needed it in a design that works for me.
I'm trying to convert this system to Access to give me more control over the data and to try and make the process of creating the list a little more automated. I also have an Access database for "tracking", which is required by hospital management so I was hoping I could use the patient list database to streamline the process of entering interactions into the tracking database.
I'm not sure how to get the copied and pasted patient list into an Access in a way that will let me manipulate it in Access to do what I want it to do without having to add several steps of a) pasting it into Excel, b) importing the spreadsheet into the Access database, and c) cleaning the data that ends up in the final Access table.
Is there a way to import data in a spreadsheet or table format directly from the clipboard, which would allow me to skip Excel altogether? I'm using Access and Excel 2010.
I have an MS Access accdb with linked SQL Server 2012 ODBC tables. I am working on a procedure to copy data from local tables to these linked tables (identical schema). I did a simple
Code:
DoCmd.RunSQL "INSERT INTO linkedTable SELECT * FROM localTable"
This works, but is very slow. Way too slow. (INSERT copies the data one record at a time).
I would like to copy the data in a bulk operation, or operations that I can execute programmatically.
I have one DB that is used for creating/storing customer ID's, and another DB that is used for creating/storing job information for customers.I have linked the table from the customer DB to the job DB.
There is a table in the job database that holds customer name and ID, and some VBA that generates unique job codes.
Is it possible to have the data from the linked table automatically update into the existing table?
I am trying to write an update query which will return a value within a new table, based on a date in my import table.
The date format is dd/mm/yyyy and I want to return the month in another column (ie 01 to 12).
To complicate matters, I want to return a value based on some additional logic. My invoice statements run on a cycle of 17th of the month to the 16th of the next month.
So if a date value in a line item of text in table 1 says 17/11/2007 to 16/12/2007, I want the value returned in my new column to be 11. If the date range is from 17/12/2007 to 16/01/2007 then I want the value returned as 12.
My American colleague wrote the following expression, but due to the different way we write dates in Europe, can't quite get this to work.
I have rather complex select statement (at least for me) that produces a summary of how a team scored in a league competition that week. I would not even worry about this issue, except that people float around as alternates and I deduced it would be easier to compute and store scores for a team the week they shot with a given group of people versus keeping track of who shot on what team over a 10 week period.
The selection takes 40 individual scoring records and consolidates them into 10 team summary records. I have verified that the query works, but implementing it has turned into a problem.
Problem one: my knowledge of recordsets is almost purely theoretical at this point, having never worked with them. Therefore commands and structures are a problem - mainly, I'm not sure what code is needed to post a recordset to a table
Problem two: the select statement that works as an Access query is bombing in VB
My code to date:
Dim RS As Recordset Dim DB As Database Dim strSQL As String Dim inpWeekNum As Integer
inpWeekNum = 0 'InputBox "Enter Week Number" 'eventually request week number from user. an integer from 0-9
'strSQL = "SELECT tblRoster.* FROM tblRoster WHERE (NIGHT = 'Fri');" 'a test str. this worked. strSQL = "SELECT tblRoster.TEAM, tblScores.WeekNo, " & _ "Sum([A1T1]+[A1T2]+[A1T3]+[A2T1]+[A2T2]+[A2T3]+[A3T1]+[A3T2]+[A3T3]) AS TeamTotal," & _ "Sum([A1T2X]+[A1T3X]+[A2T2X]+[A2T3X]+[A3T2X]+[A3T3X]) AS TeamXs" & _ "FROM tblRoster LEFT JOIN tblScores ON tblRoster.HEDR = tblScores.HEDR" & _ "GROUP BY tblRoster.TEAM, tblScores.WeekNo HAVING (((tblScores.WeekNo)=0))" 'hardwired week number ' "GROUP BY tblRoster.TEAM, tblScores.WeekNo HAVING (((tblScores.WeekNo)=inpWeekNum))" 'user prompted week number
Set DB = CurrentDb() Set RS = DB.OpenRecordset(strSQL)
Do While Not RS.EOF 'Appending Code here... 'obviously missing code, but I know that it does cycle through as I would expect it to. RS.MoveNext Loop
'This was a previous test based on a canned qry I had saved (that resembles the above qry. ' this successfully posted, but only one record 'DoCmd.RunSQL "INSERT INTO [tblTeamScores](TeamNo, WeekNo, TeamTotal, TeamXs) " &_ ' "VALUES (" & TEAM & ", " & WeekNo & ", " & TeamTotal & ", " & TeamXs & ")"
The select statement correctly produces this output in Access (for Week 0):
TEAM WeekNo TeamTotal TeamXs (how does one properly post a table in this interface?)
i have a table with tons of records in it. There is a field called "date to return by" that previously had a default value of Date+30. Now, some things changed in our company, and under certain conditions, the "date to return by" for new records will be Date+14, or Date+30. At first, i tried making this relationship in a table as a default value, but, you cannot make a relationship like this in a table. So, i made a query to evaluate the relationship. what i want to do, is have a query that will have all the same fields the table had and evaluate whether a records' "date to return by" should be Date+30 or Date +14, and then put that new record back in the table.. but, this will only be for new records, as i will be keeping all the old records in the table as they are. how can i do this? all of my reports read off of my table so i want to keep the table. can i make a query that will put new records into a table one at a time as i make them?
I have a database with existing tables.I now want to add a whole bunch of records into my access tables.A lot of the data is repeated, and lends itself to my doing it in excel with it's better copy and paste abilities, and it's ability to easily increment alphanumeric fields.I can't seem to succeed in append importing to the bottom of my access table from my excel spreadsheet. All columns are the same.Can this be done, and if so how please?I'm on XP Pro with Office 2003 Pro.I'm also very much a newbie in Access.