Solved

Convert drive letter to UNC path in hyperlink field

Posted on 2007-03-26
3
1,052 Views
Last Modified: 2008-01-09
I was given a solution in this question:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_22472446.html

CODE
-------
TextDrive = ServerLink
strDrive = Left(TextDrive, 2)

Dim objWMI
Set objWMI = GetObject("winmgmts:\\.\root\CIMV2")
Set colDisk = objWMI.ExecQuery("Select * From Win32_LogicalDisk Where DeviceID='" & strDrive & "'")
For Each Item In colDisk
  ServerLink = Replace(TextDrive, strDrive, Item.ProviderName)
Next
--------

That converts a network drive letter to a UNC path. It worked great until I tried using it on a field that was formatted for a hyperlink. I think that the automatic # symbols that are put at the beginning and end of the link are screwing it up because it doesn't do anything now. How would I modify this for a hyperlink field?
0
Comment
Question by:MDauphinais1
  • 2
3 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
use the replace function

replace(string, "#","")
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility

textDrive=Replace([hyperlinkfield],"#","")
0
 

Author Comment

by:MDauphinais1
Comment Utility
Awesome. Thanks.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now