Solved

Convert drive letter to UNC path in hyperlink field

Posted on 2007-03-26
3
1,057 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18794477
use the replace function

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

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 18794483

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

Author Comment

by:MDauphinais1
ID: 18794533
Awesome. Thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 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