Clicking on Hyperlink question - 10-05-2004 , 07:26 PM
If I create a field as a hyperlink, Access will open the hyperlink if I
single click it.
Is there a method within the operating system that would tell access to
only open the hyperlink if double-clicked? Is there anything I can do
so that Access will open a hyperlink on a double-click?
I find opening a hyperlink on a single click annoying. One reason I
find it annoying is that I can't single click and then right click to
edit/update the hyperlink field via a short-cut menu. Access wants to
open the field and external program up immediately.
I have been using HyperlinkPart so I can control the single click and I
can shade the control as underline and blue to simulate a hyperlink.
This works fine in continuous forms but the underline and blue
foreground disappear if it is a datasheet (I am using A97). In this
instance I want to use a datasheet.
Re: Clicking on Hyperlink question - 10-06-2004 , 02:24 AM
fart when they decided to implement hyperlinks into Access.
Re: Clicking on Hyperlink question - 10-06-2004 , 04:19 PM
how about a textbox, underlined and blue with a doubleclick event
not sure of origin, not mine you can tell by lack of naming conventions
and exit functions all over the place.
--- code start ---
Declare Function WinAPI_ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As
String, ByVal nShowCmd As Long) As Long
Function RunFile(pstrShell As String, Optional pstrWhat As String,
Optional pvarRunStyle As Variant, Optional pstrParam As String)
Dim runstyle As String, workdirpath As String, FilePath As String
Dim success As Variant
If IsMissing(pvarRunStyle) Then
runstyle = "1" 'Run it normally, in a window
runstyle = pvarRunStyle
'workdirpath = GetPath(strshell) 'define working directory
FilePath = pstrShell ' and the document or exe, with path
If Len(pstrParam) Then
success = WinAPI_ShellExecute(0, pstrWhat, FilePath, pstrParam,
If Len(pstrWhat) Then
success = WinAPI_ShellExecute(0, pstrWhat, FilePath,
vbNullString, workdirpath, runstyle)
success = WinAPI_ShellExecute(0, vbNullString, FilePath,
vbNullString, workdirpath, runstyle)
RunFile = success
--- code end ---
Re: Clicking on Hyperlink question - 10-06-2004 , 07:05 PM
On Wed, 06 Oct 2004 22:19:28 +0100, Trevor Best <nospam@localhost>
What about the bookmark parts, and the links to objects in Office such
You can parse the original hyperlink which is really a memo field
into three parts separated by # signs, representing the local path,
full path and bookmark.
More work needed here!
The problem is the requirement for datasheet view, which exposes the
hyperlink to clicks, or requires you to provide another data type and
duplicating quite a lot of functionality, including the ability to
load the field from a toolbar button. I thought of using a continuous
form and setting the cursor movements to simulate datasheets, or
subclassing the whole form and intercepting mouse clicks .... all too
difficult. Maybe there is a simple way.
Re: Clicking on Hyperlink question - 10-06-2004 , 08:29 PM
Trevor Best wrote:
been using a routine I found at MVPS a couple years ago for opening the
file (link) maximized. I appreciate the time you spent to post your code.
I guess my complaint with hyperlinks (not using HyperlinkPart or
whatever) is that 1) it has a single click. If you single click on the
field, that opens an external program that may be slow in loading. 2)
You can't edit the display text or hyperlink easily since if you go into
the field, it opens the link before you can edit. 3) It minimizes
Access that adds more work to end users. 4) A hyperlinkpart is not
displayed as a hyperlink color in a datasheet.
It's as if MS went out of its way to ensure the developer has absolutely
no control over hyperlinks. And that I am forced to use continuous
forms and use options like HyperlinkPart and code like yours to make it
Regarding hyperlinks...I am glad MS provided them. As far as their
implementation, I give them an F. And I put the responsibility of
failing onto the MS Access project manager. If a guy like the PM is
impressed by the coding cowboys, he/she won't pay attention to the
usefulness. That is why I firmly believe the PMs should have some