Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileDialog box - Setting path ?

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
I have some code that I would like to set the path variable on within the FileDialog box. I have not been able to fig out how to setit . It defaults to the DB "default DB Folder" The following rtn works OK but its always used this def db location as the path. I want ot bea able to control that path within the code.

Any suggestions would be greatly appreciated !!!

===========================================================

Private Sub FileDialog_Click()
On Error GoTo Err_FileDialog_Click

Me.txtFilePath = "No File Selected"

Dim fname As FileDialog
Dim itm As Variant
Dim strInitialfile As String

Stop
Set fname = Application.FileDialog(msoFileDialogFilePicker)
With fname
.Filters.clear
.Filters.Add "Dat Bank Files", "*.Dat", 1
.AllowMultiSelect = False
If .Show = True Then
For Each itm In .SelectedItems
Stop
Me.txtFilePath = itm
' Stop
' DoCmd.TransferText code here ...
Next
End If
End With


Tom Moran
Lansing, Michigan
 
Something like this ?
.InitialFileName = "\path\to\initialfolder"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top