By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,704 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

Variable %username% substitution on File Import Specification

P: n/a
I need to reference each user's (many) home share on a network and tried
using the Wndows %username% to do so but this did not work to reference the
directory where my import tables will be using the import specification.

my syntax for file to import was
\\ usrshare\ %username% \data\ foo.txt
Any help would be appreciated

d
Dec 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I dont think you would need the % around the username unless it has them in
the actual path.
I reacon it should be \\usrshare\username\data\foo.txt

You may need to stick the domain infront if its not the full path

hope that helps

"M Cavanagh" <m-********@earthlink.netwrote in message
news:8U*****************@newsread3.news.pas.earthl ink.net...
>I need to reference each user's (many) home share on a network and tried
using the Wndows %username% to do so but this did not work to reference the
directory where my import tables will be using the import specification.

my syntax for file to import was
\\ usrshare\ %username% \data\ foo.txt
Any help would be appreciated

d

Dec 2 '06 #2

P: n/a

M Cavanagh wrote:
I need to reference each user's (many) home share on a network and tried
using the Wndows %username% to do so but this did not work to reference the
directory where my import tables will be using the import specification.

my syntax for file to import was
\\ usrshare\ %username% \data\ foo.txt
Any help would be appreciated

d
use a function

Dim strPath as string
strPath = "\\usrshare\" & fOSUserName & "\data\foo.txt"

you can get the fOSUsername function here:
http://www.mvps.org/access/api/api0008.htm

Dec 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.