ProgramRasta
Member
- Local time
- Today, 05:50
- Joined
- Feb 27, 2020
- Messages
- 98
Hi All
I have a very frustrating issue and I am unable to understand why it's happening.
I have the following code that imports a .csv file into a database table with the format I want.
However, when I initially run the code I get an 'invalid argument' error.
I need to actually attempt to import the file manually into the database, cancel the import and then the code runs normally.
Anyone any ideas on why this occurs and hopefully provide some guidance on a fix?
Many thanks
I have a very frustrating issue and I am unable to understand why it's happening.
I have the following code that imports a .csv file into a database table with the format I want.
Code:
DoCmd.TransferText TransferType:=acImportDelim, _
SpecificationName:="ImportSpecification", _
TableName:="tbl_Importtable", _
FileName:=ImportFileName, _
HasFieldNames:=True
However, when I initially run the code I get an 'invalid argument' error.
I need to actually attempt to import the file manually into the database, cancel the import and then the code runs normally.
Anyone any ideas on why this occurs and hopefully provide some guidance on a fix?
Many thanks