Simple Browse Question

brsawvel

Registered User.
Local time
Today, 08:25
Joined
Sep 19, 2007
Messages
256
Hello, How do I create a cmd button to open a browse and enters the path of the file I select in the browse into a txtbox on the same form as the browse button?
 
put this behind the click event of the button
Code:
Sub FOO()

Dim varitem As Variant

      With Application.FileDialog(msoFileDialogFilePicker)

         With .Filters
           .Clear
           .Add "All Files", "*.*"
         End With

             .AllowMultiSelect = False
             .InitialFileName = [color=red]FULL PATH OF THE SOURCE DIRECTORY YOU WANT TO OPEN (IN QUOTE MARKS)[/color]
             .InitialView = msoFileDialogViewDetails

                    If .Show Then

                       For Each varitem In .SelectedItems
                          me.[color=red]YourTextBoxName[/color] = Varitem
                       Next varitem

                    End If

      End With

End Sub
 
BTW, good to see you again BrSawvel. Long time no see, huh? :)
 

Users who are viewing this thread

Back
Top Bottom