Experts Exchange connects you with the people and services you need so you can get back to work.
Dim strFolder As String
Dim strRoot As String
strRoot = "C:\"
strFolder = Me!TextBox1.Value ' [Forms]![MainForm]!TextBox1.Value
If Len(Dir(strRoot & strFolder, vbDirectory)) = 0 Then
MkDir strRoot & strFolder
Open in new window
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long
Public Sub CreatePath(ByVal Path As String)
If Right(Path, 1) <> "\" Then
Path = Path & "\"
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
Private Sub txtTarget_DblClick(Cancel As Integer)
Dim Dialog As FileDialog
Dim Selected As Long
Set Dialog = FileDialog(msoFileDialogSaveAs)
.AllowMultiSelect = False
.InitialFileName = Nz(Me!txtTarget.Value)
.Title = "Name saved file"
Selected = .Show
If Selected <> 0 Then
Me!txtTarget.Value = .SelectedItems.Item(1)
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.