Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Open Folder in Access form button with VBA

Posted on 2013-01-16
Medium Priority
Last Modified: 2013-01-16
I am trying to open a folder on a drive by assigning vba code to a button on my Access form.

If I hard code this path works fine.  When I try to assign a variable I get and error path doesnot exist.  Any ideas on what I am doing wrong??

Works fine......
Shell "explorer /e, C:\SystemProjectFiles\Ashland", vbNormalFocus

Not working.....
Shell "explorer /e, " & FolderPath & """, vbNormalFocus"

Question by:RobertStamm
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38783924

followhyperlink "C:\SystemProjectFiles\Ashland"

Author Comment

ID: 38783951
That works but I need to turnoff the hyperlink warning message.  Any ideas on how to do that?
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38783955
ok try

Shell("explorer.exe C:\SystemProjectFiles\Ashland",4)


Shell("explorer.exe C:\SystemProjectFiles\Ashland",vbnormalfocus)
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf


Author Comment

ID: 38783979
This gets me back to my orginal question....who do I write the statement to replace C:\SystemProjectFiles\Ashland with a variable called FolderPath?
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 38784032
Dim FolderPath As String
FolderPath = "C:\SystemProjectFiles\Ashland"

Call Shell("explorer.exe " & FolderPath, 4)


Shell "explorer.exe " & FolderPath, 4

Author Comment

ID: 38784442
Perfect....Thanks for your help.

Author Closing Comment

ID: 38784448
Thanks again!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question