--TripWire--
asked on
Repated data import - MS Access
Hello,
I previously asked a question about importing data from a csv to MS Access, found here: http://www.experts-exchang e.com/Data base/Misce llaneous/Q _26781566. html
During this thread, someone asked me if this would be a one time thing, or repeated.
To which I answered, one time - but I've found out since then that it will be a repeated action after all.
Someone suggested using: DoCmd.TransferText transfertype:=acImportDeli m, _
tablename:="tblMonthlyData ", _
FileName:="D:\Documents\Ex amples\Mon thly Data.csv", _
hasfieldnames:=False
But I would like a step-by-step procedure as to how to do this if possible.
(Screenshots would help please)
Thank you
I previously asked a question about importing data from a csv to MS Access, found here: http://www.experts-exchang
During this thread, someone asked me if this would be a one time thing, or repeated.
To which I answered, one time - but I've found out since then that it will be a repeated action after all.
Someone suggested using: DoCmd.TransferText transfertype:=acImportDeli
tablename:="tblMonthlyData
FileName:="D:\Documents\Ex
hasfieldnames:=False
But I would like a step-by-step procedure as to how to do this if possible.
(Screenshots would help please)
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can't do so easily, but you can import to a Temporary table, and then use Access methods to move the data from your 5 fields to your "live" Access data. To do that, you'd run code like this AFTER your call to TransferText:
Currentdb.Execute "INSERT INTO YourLiveTable(Col1, Col2, Col3) SELECT Col1, Col2, Col3 FROM YourTemporaryTable"
Obviously you'd need to change the Table and Column names to match your project.
Currentdb.Execute "INSERT INTO YourLiveTable(Col1, Col2, Col3) SELECT Col1, Col2, Col3 FROM YourTemporaryTable"
Obviously you'd need to change the Table and Column names to match your project.
ASKER
Ok Thanks. Is that run in a Macro as well?
Will the auto-number PK I have in my table populate by itself when I insert this data?
Will the auto-number PK I have in my table populate by itself when I insert this data?
ASKER
Thanks for your help. So far what you've suggested has worked.
Only, I've noticed the newly imported values have appended "3775" to the front of my auto-number field.
For example, my records will auto-number (incrementing by one each time) and then suddenly they'll change when it gets to the new values.
2065, 2068, 37752069, 37752070, 37752071...
Please help
Only, I've noticed the newly imported values have appended "3775" to the front of my auto-number field.
For example, my records will auto-number (incrementing by one each time) and then suddenly they'll change when it gets to the new values.
2065, 2068, 37752069, 37752070, 37752071...
Please help
ASKER
For example. Lets say my Access table has 15 fields, but I only want to import 5 fields from my csv. How would I go about this?