I need to use VBA to set directory

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top