• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1071
  • Last Modified:

Convert drive letter to UNC path in hyperlink field

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
MDauphinais1
Asked:
MDauphinais1
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
use the replace function

replace(string, "#","")
0
 
Rey Obrero (Capricorn1)Commented:

textDrive=Replace([hyperlinkfield],"#","")
0
 
MDauphinais1Author Commented:
Awesome. Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now