Convert text to hyperlink data type

mcrafty

New member
Local time
Today, 08:23
Joined
Mar 27, 2013
Messages
3
I am trying to create a "browse" button on a subform which will allow the user to browse for a file name using the standard Wndows interface and insert that name in an underlying table field with a hyperlink data type.

I am working in Access 2007 and am using Microsoft KB888695 code to call the common dialog API from comdlg.dll. I have been able to get the code to call the "GetOpenFileName" dialog and pass the file name as string data to a text box that has a hyperlink data type field as its source. The data being passed looks something like "h:\mcaFFEdb\MasterCatalog\A12.pdf" but, once in the text box or viewed directly from the table the link is no longer "hot". Manually entering the path and file name into the text box results in a "hot" hyperlink.

I can't find a function in Access to perform the conversion and have not been able to determine enough about hyperlink data type syntax to make my own.

Any clues are greatly appreciated.
 
You could always leave it as text and then have an Event Procedure on the OnClick that opens the file.
 
JD,

Thanks for the response. I actually found another answer from an obscure source. It seems as if a hyperlink needs to be surrounded by hash marks just as a string wants quote marks.

i.e. #H:\MyPath\MyFileName.PDF# instead of "H:\MyPath\MyFileName.PDF":banghead:

Thanks for giving me some help!
 

Users who are viewing this thread

Back
Top Bottom