different paths for shared drive (1 Viewer)

odun

Registered User.
Local time
Today, 01:51
Joined
Apr 24, 2005
Messages
108
Hello all:

I have the following code to retrieve doucments:

strPath = "G:\Corp\Customer Files\"

Application.FollowHyperlink strPath & "\" & textbox1 & "-" & textbox2 & ".doc"

This works fine from my computer because the shared drive on my computer is saved on the G drive.

I tried using the code from a coworker's computer, but got an error because her shared drive is : "X:\Corp\Customer Files\"

Basically anyone can access the Corp server through any drive depends on how it was mapped.

How do I get around this so that it works from any computer as long as the user has the Corp share drive?

Thanks much.
 

ssteinke

for what it's worth
Local time
Today, 04:51
Joined
Aug 2, 2003
Messages
195
Probably the best method for what you are looking to accomplish would be to save the location of the file in a table and use the actual UNC Path to make the connection.

For example: \\Server\Folder\File.doc

This won't require each user to be mapped with the same drive, do a search for UNC Path and that may give you some more ideas.

Good Luck,

Scott
 

odun

Registered User.
Local time
Today, 01:51
Joined
Apr 24, 2005
Messages
108
Hi Scott,

I don't even know why or how a linked table works. I don't know what a link table does.

I did research the UNC but don't understand much of what was discussed.

I do know my server name: Finance and share name: corp.

\\Finance\Corp\CustomerFiles

But the documents are all saved in the CustomerFiles folder. The code below searches the CustomerFiles folder to see a file name that matches with 2 textboxes on the form:

strPath = "G:\Corp\Customer Files\"

Application.FollowHyperlink strPath & "\" & textbox1 & "-" & textbox2 & ".doc"

I will try changing the code to this may it will work:

strPath = "\\Finance\Corp\CustomerFiles"

Application.FollowHyperlink strPath & "\" & textbox1 & "-" & textbox2 & ".doc"


Any ideas and step my step direction will be helpful. Thanks a lot.
 

ssteinke

for what it's worth
Local time
Today, 04:51
Joined
Aug 2, 2003
Messages
195
odun said:
I don't even know why or how a linked table works. I don't know what a link table does.

I only mentioned saving the file path to a table for ease of changing it later if the file moves to a different location.

For your purposes, however, if hard coding the path into your code is a viable option, simply changing the strPath name as you indicated to the UNC should take care of it.

Hope it works,

Scott
 

odun

Registered User.
Local time
Today, 01:51
Joined
Apr 24, 2005
Messages
108
Scott...thank you so much.

the path code you gave me worked,\\Server\Folder....

I find that it is slower though compared to drive:\folder...

Is there a way around it?:)
 

Users who are viewing this thread

Top Bottom