How export file to server directory

The following code works well when I want to export a file to the user's desktop:

DoCmd.TransferText acExportDelim, , "tblMailingList", strCSV & Environ("userProfile") & "\Desktop\" & "Mail List " & Format(Now, "mm-dd-yyyy_hh-nn") & ".csv"

But in a new situation I am logged in to a remote server using remote desktop connection and need the file to be exported to a remote server folder.  I tried this but it doesn't work:

DoCmd.TransferText acExportDelim, , "tblMailingList", strCSV & "\\S:\Access Applications" & "Mail List " & Format(Now, "mm-dd-yyyy_hh-nn") & ".csv"

What is wrong with it?
SteveL13Asked:
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.

PatHartmanCommented:
What are the leading "\\" for?  you can't use UNC notation along with a drive letter.  Open a Windows Explorer window and navigate to the folder.  Click into the path name and assuming your properties are set to show the path (if not, change the properties), copy what you see and use that.
0
Gustav BrockCIOCommented:
I can't believe strCSV holds anything but en empty string - or your current code would fail - so use this:
DoCmd.TransferText acExportDelim, , "tblMailingList", "S:\Access Applications\" & "Mail List " & Format(Now, "mm-dd-yyyy_hh-nn") & ".csv"

Open in new window

/gustav
0

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
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 Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.