Filenames and fields

G

Guest

Hi there, i have just used this code to create a folder using a field name
Dim strPath As String

strPath = "\\Server\Database\CKS\Data\" & Me.JobNo
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir (strPath)
End If
Shell "explorer.exe " & strPath, vbNormalFocus

However i want to create more folders in the directory but have been
unsuccessful in my attempts, for example, in the newly created folder i want
to also put a 'Services' fo9lder in there, but i am struggling to do it, any
help much appreciated, thanks WK
 
D

Douglas J. Steele

Actually, the parentheses aren't required:

strPath = "\\Server\Database\CKS\Data\" & Me.JobNo
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
MkDir strPath & "\Services"
End If
Shell "explorer.exe " & strPath, vbNormalFocus

Using parentheses would change the call from ByRef to ByVal. Granted, in
this case it doesn't really matter.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"Pieter Wijnen"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top