working directory VBA

awake2424

Registered User.
Local time
Today, 06:29
Joined
Oct 31, 2007
Messages
479
Is it possible in access 2010 o create a button with a VBA code behind it in which a user can select a working directory? Instead of having to type C:\cygwin\home\cmccabe the user can click on a button and select/ navigate to this location. Thanks.
 
paste into a button click.

Code:
   Set objDialog = Application.FileDialog(4)
    With objDialog
        .AllowMultiSelect = False
        .Title = "Please select a File"
        .InitialFilename = "C:\"
        .Show
        If .SelectedItems.Count = 0 Then
            MsgBox ("Action Cancelled")
        Else
 
            For Each Item In .SelectedItems
                MsgBox (Item)
            Next
        End If
    End With
    Set objDialog = Nothing
 
Thank you very much, I appreciate your help.
 

Users who are viewing this thread

Back
Top Bottom