Solved

Open Folder in Access form button with VBA

Posted on 2013-01-16
7
567 Views
Last Modified: 2013-01-16
Experts,
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"

Thanks,
Bob
0
Comment
Question by:RobertStamm
[X]
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
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38783924
try

followhyperlink "C:\SystemProjectFiles\Ashland"
0
 

Author Comment

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

Expert Comment

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

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

or


Shell("explorer.exe C:\SystemProjectFiles\Ashland",vbnormalfocus)
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 

Author Comment

by:RobertStamm
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?
0
 
LVL 120

Accepted Solution

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

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

or

Shell "explorer.exe " & FolderPath, 4
0
 

Author Comment

by:RobertStamm
ID: 38784442
Perfect....Thanks for your help.
0
 

Author Closing Comment

by:RobertStamm
ID: 38784448
Thanks again!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

627 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