Marco Krechting wrote:
Hi All,
Sorry but I have to create new message since it cannot find the old
message to send a reply.
You can always use Google Groups. Set the search to Advanced. Enter
*Access* in the groups. Enter either your name or your e-mail address
in the From part.
Most newsreaders allow you to do a search. If you can't do that, you
may never find this response let alone your initial message.
Coming back to this hyperlink thing I will try to explain the real problem cause I think we are going in circles.
I have a continous form with a hyperlink field on it. Normally when
you click on a hyperlink field Access will follow the Hyperlinkbase
set in the database.
This is for example in my case "I:\". However I have two different
hyperlink fields in my database. One of them has documents in "I\In"
and the other in "I\Out". So I thought lets add the direction to the
proper folder in the code (see below). That does work by the way. The
only problem is that Access, after opening the word.doc, comes up with
a error message that it could not find the document. That logic
because it is looking in "I\". But I already worked around that by
building this code.
The big Q is how do I get rit of this error message?
Private Sub HYPERLINK_Click()
Dim str As String
If Not IsNull(Me.HYPERLINK) Then
str = Me.HYPERLINK
Application.FollowHyperlink "In\" & str
End If
End Sub
Regards,
Marco
Well, I asked if you would do a Debug.Print on "In\" & str so you could
see the result.
At least you provided some more info this time. So you set the path to
"I\". Having worked for a few years on computers, I guess you aren't
working on Windows. Are you working on Linux, Unix, or some proprietary
operating system? Usually one would expect "I:\" where the colon
separates the drive from the folder.
Let's assume the file name is called Test.Doc. In your code you
concantenate "IN\" with "I\Test.Doc". The net result is "IN\I\Test.Doc".
Again, this must be a proprietary operating system. It does not follow
normal Windows/Dos file name specifications. Nor does it follow
relative addressing name structures.
I would perhaps read how a filename path is created in some help files
or get onto google and read some directions on creating relative path
and file names, or perhaps create another message and ask how to create
a filename path and how to create a relative addressing path. Once you
have that concept nailed down you should be able to open the file.
Until then, you'll continue spinning in circles.
Also, you should learn how to do a Debug.Print and know where to look to
view the results. Check help for info on Debug. Look in your menu bars
for Immediate Window when you have a code module open once you know how
and when to use Debug.Print.