Access.2007.VBA.Bibl..

(John Hannent) #1
FIGURE 11.6
The main menu of the Synchronizing Contacts database.

The code for the Attachments Folder Path button (listed next) starts by popping up a Folder Picker
dialog for selecting the folder where files to be used as attachments are stored. The selected path is
saved to the textbox under the command button:

Private Sub cmdAttachmentsFolderPath_Click()

On Error GoTo ErrorHandler

Create 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 attachments “ _
& “should be stored”
.ButtonName = “Select”
.InitialView = msoFileDialogViewDetails
.InitialFileName = strPath

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf