Hyperlink error message (1 Viewer)

Chrstine Pearce

Registered User.
Local time
Today, 02:57
Joined
Oct 20, 2003
Messages
12
I table has a field called Attachment, formatted as a Hyperlink.

The field appears on my form with an On Click Event Procedure.

Private Sub Attachment_Click()

If IsNull(Attachment) Then
DoCmd.RunCommand acCmdInsertHyperlink
Else
DoCmd.RunCommand acCmdOpenHyperlink
End If

End Sub

When the Else bit happens, the hyperlink opens just fine, but when you close the hyperlinked document application, the following message appears:

Unable to open ../<document path and name>. The hyperlink cannot be followed to the destination

Why does this happen, and what can be done to be rid of it?

Many thanks,
Christine
 

Fizzio

Chief Torturer
Local time
Today, 02:57
Joined
Feb 21, 2002
Messages
1,885
Have you tried using the followhyperlink method instead?
 

Chrstine Pearce

Registered User.
Local time
Today, 02:57
Joined
Oct 20, 2003
Messages
12
Fizzio, I don't see that there is such a think as a "acCmdFollowHyperlink", if this is what you meant me to do.

Cheers, Christine
 

Chrstine Pearce

Registered User.
Local time
Today, 02:57
Joined
Oct 20, 2003
Messages
12
Fizzio,

DAH! - I see now what you meant by the follow hyperlink method - it's not a command!

At any rate, I figured it out!!!! :-

Private Sub Attachment_Click()
If IsNull(Attachment) Then
DoCmd.RunCommand acCmdInsertHyperlink
Else
' Do nothing: the hyperlink opens automatically!!!!
End If
End Sub

Thank you,
Christine
 

Users who are viewing this thread

Top Bottom