By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

trap hyperlink error message

P: n/a
Hi All,

I have two hyperlinkfields in my database. Both fields have to point to
different folders. One is called "IN" and the other "OUT".
Access can have only one hperlinkbase. That's why I added some code for
the click event, namely:

Private Sub link_Click()
Dim str As String
If Not IsNull(Me.link) Then
str = Me.link
Application.FollowHyperlink "In\" & str
End If
End Sub

This way I can have the files in different folders and still open them.
The problem, however is that I cannot get rit of this error message of Access
saying It cannot open the specified file.

Any thought,

Marco
The Netherlands
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Krechting wrote:
Hi All,

I have two hyperlinkfields in my database. Both fields have to point to
different folders. One is called "IN" and the other "OUT".
Access can have only one hperlinkbase. That's why I added some code for
the click event, namely:

Private Sub link_Click()
Dim str As String
If Not IsNull(Me.link) Then
str = Me.link
Application.FollowHyperlink "In\" & str
End If
End Sub

This way I can have the files in different folders and still open them.
The problem, however is that I cannot get rit of this error message of Access
saying It cannot open the specified file.

Any thought,

Marco
The Netherlands


Check out HyperlinkPart

h = "Test.Doc#C:\Test\Test.Doc"
? hyperlinkpart(h,acDisplayedValue)
Test.Doc
? hyperlinkpart(h,acDisplayedValue)
Test.Doc
? hyperlinkpart(h,acAddress)
C:\Test\Test.Doc

You should be able to manipulate the address to point to the folder you
want.

Actually, MS's hyperlink implementation sucks in several areas. You'd
probably be better off parsing out the display from the address and then
modifying the OnClick to open the file based on the address.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.