Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink to a specific directory

Status
Not open for further replies.

kgerlitz

Technical User
Oct 2, 2004
84
0
0
US
I would like to click on a command button that will take me (via hyperlink) to a Windows Explorer folder that is named exactly the same as the records ID field.

Is this possible?
 
You may try this:
Set Sh = CreateObject("WSCript.Shell")
Sh.Run "\path\to\" & Me![ID control]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello PHV,
I am also looking for an answer to a similiar problem.
Perhaps you can elaborate your answer little more?

I don't understand where to enter the code that you have written viz -- Set Sh = CreateObject("WSCript.Shell")

Many thanks
 
looking for an answer to a similiar problem
What is exactly YOUR problem ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello PHV,
It is great to see such a fast response from you.

I have different folders in Windows Explorer for which the hyper link is to be created in a command button say "Command1" in Form1. Folders are as below--
C:\transmission/a
C:\transmission/b
C:\transmission/c
C:\transmission/d
C:\transmission/e

There is a text box say "Field1" in above form which has values a or b or c or d or e.

I want the user to have the "a" folder" opened in Window Explorer when value of "Field1" is "a" and so on.

Thanks a lot for your help.
 
Hello PHV,
It is great to see such a fast response from you.

I have different folders in Windows Explorer for which the hyper link is to be created in a command button say "Command1" in Form1. Folders are as below--
C:\transmission/a
C:\transmission/b
C:\transmission/c
C:\transmission/d
C:\transmission/e

There is a text box say "Field1" in above form which has values a or b or c or d or e.

I want the user to have the "a" folder" opened in Window Explorer when value of "Field1" is "a" and so on.

Presently I have created 5 command buttons with five different hyper links in them. And I have used the Visible property of a buitton to make only 1 button visible to the user depending on value of Field1.

But as this is a laborious method, I am looking for a better solution.

Thanks a lot for your help.
 
In the Click event procedure of Command1:
Set Sh = CreateObject("WSCript.Shell")
Sh.Run "C:\transmission\" & Me![Field1]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,
That code worked brilliantly. Many thanks.
I would be grateful if you would explain a little about meaning of the 1st line of your code?

Thanks for your help.
 
I instantiate a native Windows shell object exposed by the Scripting Runtime library.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top