I use the "Browse For Folder" module from Chip Pearson's site at: http://www.cpearson.com/excel/browsefolder.aspx
Download the zip and extract the file. It has the extension ".bas". I saved it to the desktop.
In the IDE you can import the file (FILE/Import File). It will create and name the standard module for you.
There are two functions that can be used to browse to folder. I use "BrowseFolderExplorer" because it displays more info. The other option is "BrowseFolder".
The an example of the code I use to browse to a folder is:
Code:
Private Sub cmdExportData_Click()
On Error GoTo Err_cmdExportData_Click
Dim strSaveFileName As String
Dim sPath As String
Dim bStatusBar As Variant
'msgbox variables
Dim Msg, Style, Title, Response
sPath = CurrentProject.Path & "\"
sPath = BrowseFolderExplorer("Select a Folder", msoFileDialogViewPreview, sPath)
strSaveFileName = ""
Me.Repaint
If Len(Trim(sPath)) > 0 Then
strSaveFileName = sPath & "\Statement Monthly Summary " & Me.cboMonth & " " & Me.cboYear & " Hours.xls"
DoCmd.OutputTo acOutputQuery, "EQ_StatementMonthlySummary", acFormatXLS, strSaveFileName, False
End If
'rest of the code
Works well..