create directory from multiple fields

w0od0o

Registered User.
Local time
Today, 23:44
Joined
Jan 13, 2009
Messages
87
Hi,

i have the following to create a directory

Dim DirName As String
Dim Response As String
DirName = "F:\test\" & Left(Me!contract_number, 10)

If Dir(DirName, vbDirectory) = "" Then
If MsgBox("OK to create folder!", vbOKCancel) = vbOK Then
MkDir DirName
Else
MsgBox "Create folder cancelled. Folder not created."
Exit Sub
End If
Else
MsgBox "The folder already exists..." & Chr(10) & "Please check the directories using Windows Explorer.", vbOKOnly
Exit Sub
End If
RunCommand acCmdSaveRecord
Response = MsgBox(DirName, vbOKOnly)
Exit_cmbMkDir_Click:
Exit Sub

All works fine but i would like it to create a folder named from more than 1 field,

i assume its something like:

DirName = "F:\test\" & Left(Me!contract_number, 10 & Me!Client & Me!site)

but i dont think this is quite correct,

All help is grateful

Thanks

w0od0o
 
It would be:

DirName = "F:\test\" & Left(Me!contract_number, 10) & Me!Client & Me!site
 
It would be:

DirName = "F:\test\" & Left(Me!contract_number, 10) & Me!Client & Me!site


thank you

i assume if i want to add some "-" in between then it would be

DirName = "F:\test\" & Left(Me!contract_number, 10) &"-" & Me!Client &"-" & Me!site

thanks again

w0od0o
 

Users who are viewing this thread

Back
Top Bottom