Specify file path in import text ACCESS 2003

I have an import that I am creating in my development version of the database.  the source for the text file is in my development environemnt, but the path will change i production.  I am a little perplexed in how to I tell the code to pick up the path in the transfer text statement?  The saved import seems to only use the original location and specification has to be added manually, I want to use the specification, but pass in the path string so I can change the variable when it goes online.

Sandra SmithRetiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
How are you doing the import now? Can you show the code you're using?
Jeffrey CoachmanMIS LiasonCommented:

Lets be clear, are you talking about an "Import Specification" (saved "during" the import wizards steps, (Click the "Advanced" button))

...Or are you referring to a "Saved Import" (created at the end of the wizard: ("Save export steps?"))

If you are using a "Saved Import", I don't think you can set the path/filename if you run this in code.

If you use an "Import Specification", you can specify the source, ...like so:
DoCmd.TransferText acImportDelim, "YourImportSpec", "YourTableName", "C:\YourFolder\YourFile.txt"
(I know that you specify the file to import in the wizard,  but this info is not saved in the in the Import Spec (AFAIK))

The distinction between the two ("Import Specifications", versus "Saved Imports" was never easy to determine...

But for automation where you need to specify the import file name  and the table name in code, I would use an Import Spec


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra SmithRetiredAuthor Commented:
Thank you, it wasd the path placement and your are right, the difference between Import Specificiations and Saved Imports had been a bit perplxed, but I got it now.  

Jeffrey CoachmanMIS LiasonCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.