Display Open folder dialog box

Benaro

New member
Local time
Today, 12:11
Joined
Jun 28, 2012
Messages
2
I want to backup my access database. Now in the application, I want the user to be able to choose a location with the aid of a folder dialog box after clicking on a browse button.
1. What code do I put under the browse button?
2. What do I use to copy the currentdb to the specified location?
 
For Open / Select / Save As dialog boxes I have had success using (I believe it is called) Microsoft Office 12.0 Object Library found in VBA \ Tools \ References. (Scroll find / check to enable)

Here is sample code of the File Open dialog form:

Code:
  Dim fDialog As Office.FileDialog
  Dim strFilename As String

  'Set up the File Dialog
  Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
  With fDialog
    .AllowMultiSelect = False
    .title = "Import Parts List - Please select one file to import into this product."
    .Filters.Clear
    .Filters.Add "Text Files", "*.csv"
    If .Show = True Then
      'Receive back which file was selected
      strFilename = .SelectedItems.Item(1)
    Else
      'Dialog cancled, so exit this method
      modparts_importwizard_ReadImportFile = False
      GoTo Exit_modparts_importwizard_ReadImportFile
    End If
  End With
 

Users who are viewing this thread

Back
Top Bottom