Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to check if dir exists and if not Create in with a variable.

Status
Not open for further replies.

aunixguru

IS-IT--Management
Feb 2, 2001
28
US
I have a project form. On it is a project name.

I need to check to see that &quot;\\server\<projectname>&quot; does not exists before trying to create it.

2nd problem.. Creating it.

I have had no luck creating anything with the use of a variable.

I can do a mkdir &quot;\\server\Access project&quot; (works)
I cannot do this: mkdir &quot;\\server\&quot; & me![projectname]

Can someone explain how to use a variable in this instance?

mkdir syntax: mkdir &quot;<name&quot;

Thanks
 
Hi there:

check if dir exists:

dim test as integer

test = len(dir(&quot;\\server\<projectname>&quot; ))
if test = 0 then
'' directory doesn't exist
'' mkdir ... --> should work like you described !!
'' --> if you want to be sure you have the
'' right syntax, test with:
str_test = &quot;\\server\&quot; & me![projectname]
msgbox str_test

mkdir str_test
end if

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top