Office Settings & Configuration

How to Set Access FileDialog to Open in Current Project Folder

Kushani NimanthikaKushani Nimanthika Oct 20, 2026 869 views

Question details

The user needs the Microsoft Access FileDialog to automatically open in the folder where the current database file resides, ensuring the path dynamically updates if the database is moved to a new location.

How to Set Access FileDialog to Open in Current Project Folder
Product
Microsoft Access
Device & OS
not provided
Scenario
Configuring a file picker dialog in an Access VBA application to default to the database's current directory.
Observed behavior
Because the application is movable, hardcoded paths fail. The developer requires a dynamic reference using CurrentProject.Path, which itself is read-only.
Before you start

Open your Microsoft Access database, ensure you have enabled macros, and confirm you have access to the VBA Editor (ALT + F11) to write or modify the FileDialog code.

Solution 1Recommended

Set the InitialFileName Property to CurrentProject.Path

Use the InitialFileName property of the FileDialog object combined with CurrentProject.Path to dynamically set the starting directory.

By using the InitialFileName property, you direct the file picker to open in a specific location. Combining this with CurrentProject.Path ensures the dialog always opens where the database file is currently located, making your application completely portable.

1
Open the VBA Editor

Press the ALT + F11 keys on your keyboard to open the Visual Basic for Applications (VBA) Editor in Access.

2
Set up the FileDialog Object

In your VBA module, declare your FileDialog variable and assign it using Application.FileDialog(msoFileDialogFilePicker).

3
Apply the InitialFileName Property

Add the code '.InitialFileName = CurrentProject.Path & "\\"' to set the default folder. If you need a specific subfolder like Images, use '.InitialFileName = CurrentProject.Path & "\\Images\\"'.

4
Display the Dialog Box

Use the '.Show' method to display the file picker box to the user and retrieve the selected file path.

Set the InitialFileName Property to CurrentProject.Path
Dynamic Path Execution: Using this approach guarantees that even if the user moves the Access database file to their Desktop or another drive, the FileDialog will still correctly identify and open the new containing folder.
Free Microsoft Office alternative

Looking for a Lightweight, Reliable Office Suite?

While Microsoft Access manages complex relational databases using VBA, many data organization and analysis tasks can be handled more efficiently with advanced spreadsheets. WPS Office is a highly compatible, free alternative to Microsoft Office that offers powerful data management tools without the heavy overhead.

  1. 1. Download WPS Office: Visit the official WPS website and download the free WPS Office installation package.
  2. 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to set up WPS Office on your computer.
  3. 3. Open Your Data Files: Launch WPS Spreadsheet and seamlessly open your existing .xlsx or .csv data exports to start managing your information.
Free, lightweight, and fast to install on any device.Fully compatible with Microsoft Excel (.xlsx, .csv) formats for your tabular data management.Intuitive interface that feels familiar, requiring zero learning curve.Built-in advanced formulas and functions for seamless data automation.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use the Filters property to change the Access FileDialog starting folder?

No, the Filters property is strictly used to specify the types of files (such as .txt or .accdb) that appear in the dialog dropdown. You must use the InitialFileName property to define the default starting path.

Why can't I change the CurrentProject.Path value in VBA?

CurrentProject.Path is a read-only property in Microsoft Access. It simply reads and returns the physical file path of the currently open database on your operating system, so it cannot be manually overwritten via code.

How do I open a specific subfolder relative to the current project?

You can easily target a subfolder by appending its name to the CurrentProject.Path property using string concatenation. For example, using '.InitialFileName = CurrentProject.Path & "\\MySubfolder\\"' will automatically open the 'MySubfolder' directory located inside your main database folder.