Open Folder command

S

Steve Pollack

Hi all,

I hope I am posting this in the correct newsgroup.
I need help with the code for the On_Click() Event for a button that will
call the standard Microsoft "Open" prompt box that navigates to a specific
folder based upon the datafile in the Access database from which the request
is being made. (i.e. "C:\Data\" & Me![Developer])
I would like to display all files in the folder.
Thanks in advance for any assistance.

Steve Pollack
 
B

Bruce M. Thompson

Use the code here http://www.mvps.org/access/api/api0001.htm

And, to default to the specified directory (I have simply modified the line in
the supplied "TestIt" function provided with the code on the above page to set
the "InitialDir" argument):

'***EXAMPLE START
MsgBox "You selected: " & _
ahtCommonFileOpenSave(InitialDir:="C:\Data\" & Me![Developer]), _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
'***EXAMPLE END
 
Top