G
Guest
Hi,
I am trying to create a procedure that imports a Text file into a single
field of a table. I can do this correctly if I do it manually by using:
File
Get External Data
Import
I select my file "DMAImportData.Txt"
I click on Import
I let the wizard use Fixed Width
The only other thing I select is the table where I want the data to go.
This puts the entire txt file in one field called field1 and I get 36 rows
of data.
Then I tried to put this in a procedure.
I used the following command:
DoCmd.TransferText acImportFixed, , "DDAImportTest",
"L:\ImportDirectory\DDAImportData.Txt"
(Of course this is one complete line in my code and not split like it is
here.)
When I run this I get the following error:
Run Time Error 2511
The action or method requires a Specification Name argument.
I don't have and didn't use one in my manual import, what do I do here?
Also, do you know how I can prompt the user to use a browse or whatever to
locate their import file because they may have the import file in different
directories?
Thanks for any help you can give!
Kathy
I am trying to create a procedure that imports a Text file into a single
field of a table. I can do this correctly if I do it manually by using:
File
Get External Data
Import
I select my file "DMAImportData.Txt"
I click on Import
I let the wizard use Fixed Width
The only other thing I select is the table where I want the data to go.
This puts the entire txt file in one field called field1 and I get 36 rows
of data.
Then I tried to put this in a procedure.
I used the following command:
DoCmd.TransferText acImportFixed, , "DDAImportTest",
"L:\ImportDirectory\DDAImportData.Txt"
(Of course this is one complete line in my code and not split like it is
here.)
When I run this I get the following error:
Run Time Error 2511
The action or method requires a Specification Name argument.
I don't have and didn't use one in my manual import, what do I do here?
Also, do you know how I can prompt the user to use a browse or whatever to
locate their import file because they may have the import file in different
directories?
Thanks for any help you can give!
Kathy