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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thanx Skip&VbMax - 1 more ?- I need To Search C for the folder 1

Status
Not open for further replies.

addicted2

MIS
Jan 16, 2002
16
AU
Thankyou heaps for your help people "RE:I need to create a folder in c:" was great and fast.
I have another situation that I need help with once a name has been entered into the input box and before it creates a new folder is there a code that will search C:Household to make sure the folder name doesn't already exist and if it does display a message box "Name Exists. Try again"

Cheers

Tony s-)
 
use something like this:

If Dir("c:\Household", vbDirectory) = "" Then
Call MkDir("c:\Household")
Else
MsgBox "Name Exists. Try again"
End If

or...in your case:

x = InputBox("Enter new folder name:")
If Dir("c:\" & x, vbDirectory) = "" Then
Call MkDir("c:\" & x)
Else
MsgBox "Name Exists. Try again"
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top