473,385 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

need to trap hyperlink error message

Hi All,

Sorry but I have to create new message since it cannot find the old
message to send a reply. 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
Nov 13 '05 #1
4 4358
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.
Nov 13 '05 #2
I'm working with Win XP, the drive letter "I" could be anything. Lets called
it C:\
The file Test.doc should be in the folder I:\In\test.doc.
The debug.print resulted in: I:\In\whatever.doc#whatever.doc# etc.....

BUt still my Q is how to lose the damn error message.

Marco

"Salad" <oi*@vinegar.com> wrote in message
news:VP*****************@newsread3.news.pas.earthl ink.net...
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.

Nov 13 '05 #3
Marco Krechting wrote:
I'm working with Win XP, the drive letter "I" could be anything. Lets called
it C:\
The file Test.doc should be in the folder I:\In\test.doc.
The debug.print resulted in: I:\In\whatever.doc#whatever.doc# etc.....
Good luck. A filename like I:\In\whatever.doc#whatever.doc# is quite
unique. It appears to be concatentating both the file name and the
display name. Someday try to use Hyperlink(). Here is an example of it.

h = "Test.Doc#C:\Test\Test.Doc" 'creates a hyperlink
? hyperlinkpart(h,acDisplayedValue)
Test.Doc
? hyperlinkpart(h,acDisplayText)
Test.Doc
? hyperlinkpart(h,acAddress)
C:\Test\Test.Doc

You might want to search google in advanced groups for threads on
hyperlinks. I believe you don't fully understand the components that
make up a hyperlink in Access and you won't succeed until you do.
BUt still my Q is how to lose the damn error message.
Pass the your FollowHyperlink a valid filename. I don't see how you can
avoid errors when you pass invalid filenames. The phrase "Garbage in,
garbage out" comes to mind.

Marco

Nov 13 '05 #4
Marco Krechting wrote:
I'm working with Win XP, the drive letter "I" could be anything. Lets called
it C:\
The file Test.doc should be in the folder I:\In\test.doc.
The debug.print resulted in: I:\In\whatever.doc#whatever.doc# etc.....

BUt still my Q is how to lose the damn error message.

Marco


Below came from another thread. Check out Allen's link.

The HyperlinkPart() function is useful for parsing the parts of the
hyperlink. More info on how hyperlinks work in:
Introduction to Hyperlink fields
at:
http://members.iinet.net.au/~allenbrowne/casu-09.html
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Krechting | last post by:
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...
1
by: Marco Krechting | last post by:
Hi All, This is a response on my earlier posting about trapping the standard access error message when you click on a hyperlink field and the file cannot be found. I know now how to work on the...
5
by: bobdydd | last post by:
Hi Everbody I am trying to trap the error that SHOULD occur when there is no internet connection. Private Sub CmdPayHere_Click() On Error GoTo Err_CmdPayHere_Click...
9
by: Leigh Kendall | last post by:
I can't find any issue in the MS KB, but I'm experiencing the following problem which seems to be specific to IE5, and NOT any other version of IE 5.5+ or NN 6+. Issue: I'm using an asp.net...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
9
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring =...
1
by: marc-andr? | last post by:
Hi, I have to loop on each control on a webforms... I use this function : public void LoopOnAllControls(ControlCollection coll) { foreach (System.Web.UI.Control ctrl in coll) {
2
by: Keith Kowalski | last post by:
I anm opening up a text file reading the lines of the file that refer to a tif image in that file, If the tif image does not exist I need it to send an email stating that the file doesn't exist...
3
by: keithb | last post by:
Using a GridView, I get a "Specified cast is not valid" error when binding the Visible propery of a hyperlink control to a DataTable text field. The error goes away if I replace the data binding...
1
NeoPa
by: NeoPa | last post by:
Error 7980: The HyperlinkAddress or HyperlinkSubAddress property is read-only for this hyperlink I'm struggling with some code to update Hyperlinks in my table. The field is defined as a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.