andrewhoddie
Board Regular
- Joined
- Dec 21, 2008
- Messages
- 114
Hi
I have an access database that I would like to update automatically but I am having issues, the debugger comes back to the table line as the issue, does anyone know why it is failing?
Also is there a way I can then delete the imported csv file or move it into a sub folder e.g. imported?
I would then like to run the macro automatically using task scheduler which I should be able to do.
thanks in advance
Andrew
Option Compare Database
Option Explicit
Public Function Import_data_files()
Dim report_path As String, file_name As String
report_path = "\\mycomputer\CVS Files\"
file_name = Dir(report_path & "*.csv", vbDirectory)
Do While file_name <> vbNullString
DoCmd.TransferText acImportDelim, , "dbo_COProperties", , True
file_name = Dir
Loop
End Function
I have an access database that I would like to update automatically but I am having issues, the debugger comes back to the table line as the issue, does anyone know why it is failing?
Also is there a way I can then delete the imported csv file or move it into a sub folder e.g. imported?
I would then like to run the macro automatically using task scheduler which I should be able to do.
thanks in advance
Andrew
Option Compare Database
Option Explicit
Public Function Import_data_files()
Dim report_path As String, file_name As String
report_path = "\\mycomputer\CVS Files\"
file_name = Dir(report_path & "*.csv", vbDirectory)
Do While file_name <> vbNullString
DoCmd.TransferText acImportDelim, , "dbo_COProperties", , True
file_name = Dir
Loop
End Function