Import and overwrite?
If not, one way I'm thinking I could possibly get around it is to change my primary key to an Autonumber field (currently I don't use any autonumbers in the table) and then run a find duplicates query on the field I am currently using as my primary key. Firstly, would this work? Secondly, having done this, how could I get the least recently acquired part of the duplicate to be ignored in the final report
Thank you for taking the time to report an issue.
What's wrong... Please write below.
What I do is download a report from the Army database into an excel format and then I upload it into the access database. This brings in along with their name, unit, training info and information that may change weekly. Now the problem I am running into is having the data from the excel import replace other records. I have a primary key in the table it goes to because that table is linked to another table where another record for the soldier is located (this has information that is not in the army databases that we want saved when we do an import).
Now if the record is not in the access database it will add that one, but will not overwrite the records already there. It really doesn't help so much because then we would have to manually do these changes (like last fitness test results and date, etc) which when you have 400+ soldiers that can be very tedious....
When I run the macro I receive a prompt saying 'The file filename already exists. Do you want to overwrite?'
I dont want to overwrite the entire file but what I would like to do is overwrite the data held in sheet one of the excel file. Is this possible?
I am using the OutputTo action for the macro export.
An error occurred trying to import file [blah]. The file was not imported.
I imported this exact file yesterday without a problem. I was importing it again to overwrite the first one because I wanted to change some of the Long Integer fields to Text.
so I tried to just import the file again from scratch, not changing anything (leaving the Long Integer fields as theyare), but I still get this error.
How do I get this command to overwrite the current table with new data each month?
Transfer Type: Import Delimited
Specification Name: STAT01 Import Specification
Table Name: 01 Data
File Name: E:\HNA Shared Other\New IT folder\I90 STATS\
Has Field Names: No
HTML Table Name:
My question is:
When you import data to the specified table does it always append
the new records to the table OR does it overwrite all the transactions in the table?
I would like to be able to click a button and import all the tables from the old version to the new one, and OVERWRITE the data.
I may add new tables in between versions, so deleting all tables before import is not an option.
my current code, does almost what I need, but it adds a number on the end, and with 50 or so tables, it's just as time consuming as the manual method.
my current code:
Dim db As Database Dim tdf As TableDef
Set db = OpenDatabase("C:\Users\userdir\Desktop\stuff\BACKUPS\main backup.mdb")
For Each tdf In db.TableDefs
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\Users\userdir\Desktop\stuff\BACKUPS\main backup.mdb", acTable, tdf.Name, tdf.Name
Set db = Nothing
I am assuming I'll probably need to index the table names in a variable somewhere and delete tables mentioned in said variable
I've used the "output" macro to output some tables from the database into a windows file directory. Until then it works.
But I want to disable the prompt which asks me if I want to overwrite the excisting file and I want to disable this prompt and that the answer is always yes.
In the previous version of Access I could import the data and it would keep any leading zeros during the import. Now it is dropping the leading zeros when I importthe data even though I have specifically formatted the data as text.
Does anyone know how I can import my data and keep the leading zeros?
what should I do? how can I get.
How would I do this?
I have included my SQL below.
SELECT [1 All Import].MSTSF, [1 All Import].[TOS Code], [1 All Import].[Rendering], [1 All Import].[ Name], [1 All Import].Net, Count([1 All Import].[Ref #]) AS [CountOfRef #], Count([1 All Import].[Apt Date]) AS [CountOfApt Date], Avg([1 All Import].[# Days]) AS [AvgOf# Days], Avg([1 All Import].[Distance]) AS [AvgOfDistance] FROM [1 All Import] GROUP BY [1 All Import].MSTSF, [1 All Import].[TOS Code], [1 All Import].[Rendering], [1 All Import].[Name], [1 All Import].Net