Solved

Convert drive letter to UNC path in hyperlink field

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

773 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