There are certain aspects of Microsoft Access that can be downright frustrating and puzzling to debug. I want to share a tip with you that will hopefully save you hours of frustration. There is nothing more foundational than importing data into Microsoft Access so most likely you’ll appreciate the fix for this run-time error if you are attempting to use VBA.
If you encounter the following Microsoft Access Error:
“Run-Time error ‘3625’: The text file specification ‘My Saved Access Import Spec’ does not exist. You cannot import, export, or link using that specification.”
Most likely you have confused a saved set of “import steps” with a saved “Import/Export specification” while trying to use the Docmd.TransferText command; or at least I did.
Consider the following sample VBA code that uses the Docmd.TransferText command to import a delimited file (from a path stored in string variable strInputFileName) into a table named “tbl_Access_Import_Data” using an import specification.
Private Sub cmd_Import_Table_Click()
Dim strInputFileName As String
'Set Path to Local CSV File. This file will be imported into an Access Table.
strInputFileName = "C:\Users\Desktop\Access Data\Access_Import_Data"
' Use a Macro to Import a delimited file
' "My Saved Access Import Spec" = Import Spec
' "tbl_Access_Import_Data" = Destination Access Table
' strInputFileName = hardcoded path to source csv file
DoCmd.TransferText acImportDelim, "My Saved Access Import Spec", "tbl_Access_Import_Data", strInputFileName
Let me show you where I went off track. I saved “import steps” and then tried to reference the saved “import steps” with the Docmd.TransferText method. You cannot reference “import steps” with this method, only “Import/Export specifications”.
I used the Import Text Wizard to define and delimit the columns in a specified .csv file and indicated the table I desired to have that data imported into. Afterwards, I pressed the finish button.
Once I hit “Finish”, on the very next screen I saved the “import steps” that I previously defined. Notice the verbiage next to step 1 (i.e. “Save import steps”).
As you can see above, I created a saved “import step” erroneously named “My Saved Access Import Spec”. This name was the value that I erroneously passed to the Docmd.TransferText method in code.
These actions result in ‘Run-time error 3625’ that we will fix.
In order to save a legitimate Import/Export specification that can be successfully referenced with the Docmd.TransferText method, make sure to hit the “Advanced” button before you hit “Finish” when you come to the last window of the Import Text Wizard.
Make sure to hit “Save As” (Step 2 above) on the right hand side of the window.
At this point, name and then save your true Import/Export specification name and hit “OK”.
Now when you come to the same window again you can hit the “Specs…” button to observe the names of all of the saved Import/Export specifications.
In the pic above I only have 1 Import/Export specification named “My Real Saved Access Import Spec”.
Observe, once the true Import/Export specification is referenced in VBA code, the code executes as intended.
I am not aware of how to edit Import/Export specifications. The best advice that I have is to recreate and then overwrite the existing specification or save the new revised specification with a different name.
If you place the following SQL code in a blank Select Query, you can view all the true specification names along with field names and respective field widths.
INNER JOIN MSysIMEXSpecs
ON MSysIMEXColumns.SpecID = MSysIMEXSpecs.SpecID
ORDER BY MSysIMEXSpecs.SpecName,
The results of that query from my example database are shown above. All due credit goes to stackoverflow for this SQL tip.
Furthermore, if you are intent on referencing saved import steps in VBA code (not to be confused with the aforementioned Import/Export specification), then use the Docmd.RunSavedImportExport method.
To execute the “import step” shown in the picture above using VBA, I would use the following command:
DoCmd.RunSavedImportExport "My Saved Access Import Spec"
I hope this helps solve your “how to fix Run-Time error 3625 in Microsoft Access” question. Good luck!
Great and very helpful article!
Glad I could help, thanks for reading!
Helped a user on another forum. Thank you.
Thank You very much! The hint “advanced” was what I was looking for …
Thanks. Exactly my problem. The “Save Import Steps” didn’t seem right. I couldn’t see anything better, even though I’d been looking at it in the advanced settings
Glad I could help!
Regarding editing Import/Export specs, check out the free tool V-Tools from http://www.skrol29.com/us/vtools.php.
Although the website shows the latest as Access 2016, I have it running under Access 2019. Read the instructions on how to install it.
very useful, thanks for saving my time
Very helpful, great help, thanks you very much for sharing solution for this problem
Thanks so much for that. I was perplexed – it seemed so simple. Why they would hide that name baffles me, but that happens.
Thanks Anthony…. great name.
Thank you very much i used it Today to solve my import erro
Glad you found it useful!
Worked perfectkly, thanks
Thank you very much!!
LikeLiked by 1 person
One of the clearest explanations I have *ever* read.
LikeLiked by 1 person
Thanks for the kind words! Glad you found the post useful.
Thanks a lot!
Brilliant. I was just having this problem. Very much appreciated the way you explained it so clearly.
Exactly the mistake I was making. (I knew all this 10 years ago. How much else have I forgotten?)
Thank you very much.
If only all support sites were as accurate and simply explained as this. Thank you so much.
Thank you for taking the time to fully explain the source, and the fix, of the error message and underlying cause.
Awesome! Thank you. That was a real head-scratcher.
Agreed! Thanks for commenting.
Works perfectly … thanks a lot