I need to use VBA to set directory

B

Brent E

Good afternoon,

I am using VBA modules to do various tasks in Access and I need to know what
commands to use to set a directory so that when I display the open dialogue
box, will show a specified directory? Any suggestions? Thanks,

Cordially,
 
B

Barry-Jon

Open a module and go to tools>refernces to ensure you have a reference
to the microsoft office object library. Then the following code should
work.


Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogOpen)

With fd
.InitialFileName = "C:\"
'etc.... etc....
End With
 
Top