Form button to open up directory ------M-------

  • Thread starter Thread starter Mark909
  • Start date Start date
M

Mark909

Hello,

I want a button that when pressed will open up a specific directory where
files are saved.

Thanks for help!
 
You want to use this construct ...

Dim strPath As String

strPath = "S:\Data\IT\Production\"
Application.FollowHyperlink strPath
 
I don't know what more to tell you. You have a button and I gave you
the code to put on the button. Are you saying that this is the first button
you've ever written code for and don't know where to begin. If so, that's
OK, but you should mention that in your post.

Go to the Click event of the button and add the code I show below. Of
course, you'll need to change my strPath to your file. I'm showing a
directory folder, because that's what you originally asked for, but you
can use the same code to open a file.

The next thing you're probably going to ask is how you get the file path
in there. If it's not hard coded, you'll have to reference a control. That
will depend on your application
 
Back
Top