Else
Debug.Print “User pressed Cancel”
End If
End WithOn Error Resume NextDoCmd.RunCommand acCmdSaveRecordErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubPrivate Sub cmdOutputDocsPath_Click()On Error GoTo ErrorHandlerCreate a FileDialog object as a Folder Picker dialog box.Set fd = Application.FileDialog(msoFileDialogFolderPicker)
Set txt = Me![txtOutputDocsPath]
strPath = GetOutputDocsPath()With fd
.title = “Browse for folder where saved documents “ _
& “should be stored”
.ButtonName = “Select”
.InitialView = msoFileDialogViewDetails
.InitialFileName = strPath
If .Show = -1 Then
txt.Value = CStr(fd.SelectedItems.Item(1))
Else
Debug.Print “User pressed Cancel”
End If
End WithOn Error Resume NextDoCmd.RunCommand acCmdSaveRecordErrorHandlerExit:
Exit SubPart II Writing VBA Code to Exchange Data between Office Components