Hi, Dutt!
Here's codes what I think will help you.
Create Common Dialog control on form and name it cmnDialog. Create command button on form and name it pbBrowse. Copy following codes into codes window.
Public strOutputFileName As String 'Default output File name
'------------------------
Private Sub pbBrowse_Click()
On Error GoTo Err_pbBrowse_Click
Dim strFilter As String
Dim strFileName As String
Dim strOutputDocName As String
Dim objDialog As Object
Set objDialog = Me.cmnDialog.Object
strOutputDocName = "MyReportName"
strFilter = "All Files|*.*"
With objDialog ' Ask for new file location.
.DialogTitle = "Open File..."
.Filter = strFilter
.FileName = strOutputFileName
.CancelError = True
.FilterIndex = 1
.flags = &H4 Or &H2 Or &H800 Or &H400 'cdlOFNHideReadOnly + cdlOFNOverwritePrompt + cdlOFNPathMustExist
.ShowOpen
' If user responded, put selection as string variable's value.
If Len(.FileName) > 0 Then
'Remember current selection
strOutputFileName = .FileName
'Update textbox with full path string
me.txtLocation=strOutputFileName
End If
End With
Exit_pbBrowse_Click:
Exit Sub
Err_pbBrowse_Click:
If Err.Number <> 32755 Then 'An error No 32755 is generated
'when the user chooses the Cancel button.
MsgBox "Error No " & Err.Number & vbLf & Err.Description
End If
Resume Exit_pbBrowse_Click
End Sub
Aivars