Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink no longer linking to file.

Status
Not open for further replies.

RobotMush

Technical User
Aug 18, 2004
197
US
I am in the process of hyperlinking scanned records to the client database I have. However, I have just found out that the first hyperlinks that I have made no longer work. In going back to hyperlink them they still have the same Drive\Directory\Sub-Directory\Sub-Directory\FileName
as before but for some reason the hyperlink no longer works for it. Remou(Technical User) has told me about FollowHyperlink as a click. In reading up on it I do not fully understand how to set it up or how it works. Would this solve my problem?

Thanks for any help and suggestions you give.

RobotMush (Technical User) Self Taught
 
Thank you fneily (Instructor) I'll read up on them.
I hope that that will solve my problem with losing the link.

RobotMush (Techincal User)
 
For better understanding on Hyperlinks read the VBA help about the HyperlinkPart method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV, so far what I have seen in VBA help and what fneily gave me is pretty much the same thing. I'm perusing through it now and I think I might have it figured out how to get it to work on what I am doing. Then again, I thought they hyperlink conection would not break down either.

Thank you for your help and suggestions

RobotMush (Techical User) Self Taught
 
Ok, I have read the information fneily and PHV have given me. From what I can make of it I don't belive I can make it work. I have 6200+ Clients that will have over 26,000 records associated with them total. That is one client might have 3 records to hyperlink while another might have 150 or more. I do not see how the follow method or the followhyperlink method will work in this case. It seems I would need 6200^26,000 buttons at least to get it to work. Am I thinking on the wrong track?

RobotMush (Technical User) Self Taught
 
I don't know you're original problem. You asked about two methods. Now for your problem - 6500 clients, are you asking about hyperlinks on a data access page (DAP) on the web, or just on a form in a single access database?
You want to hyperlink to individual records (6500*26000) - which would be ridiculous - or to files or tables containing those records?
Or, do you want to import those records into an Access table and associate them with the clients?
So, what EXACTLY do you want to do?
 
Everything but what I am Hyperlinking to is in my Database. What I am Hyperlinking to is a seperate Drive that links as...

#Drive\Directory\ClientName\Department\Year\FileName#

I do not know why my hyperlink would stop working, the only thing that I can tell different is that they added a few more records

ClientName\Department\Year\AddedFileNames.

Would the FollowHyperlink solve this problem?

I have finally got a FollowHyperlink button up and running.

Below is the Program I have created.

Private Sub GetRec_Click()

Dim count As Integer
Dim AdjHypLnk As String

On Error GoTo Error_GetRec

count = Len(HypLnk)
AdjHypLnk = Mid(HypLnk, 2, count)
Application.FollowHyperlink AdjHypLnk, , True
GetRec = True

Exit_GetRec:
Exit Sub

Error_GetRec:
MsgBox Err & ": " & Err.Description
GetRec = False
Resume Exit_GetRec
End Sub

HypLnk is the Field that has my Hyperlink Data in this form.

#Drive\Directory\ClientName\Department\Year\FileName#

What I am doing is taking the HypLnk string and finding out how long it is. I then extract the HypLnk String to the AdjHypLnk to remove the # at the front, this allows the Button to bring up the Record that HypLnk is linked to in a new window.
The question now is, if my HypLnk field is lost, will my FollowHyperlink Button still be attached to it?

Yes I realize this is a long reply, but I'm not real clear on what is happening, but it is working at this time.

Thank you for your help and suggestions.

RobotMush (Technical User)Self Taught



 
I do not know why my hyperlink would stop working, the only thing that I can tell different is that they added a few more records
ClientName\Department\Year\AddedFileNames.
Would the FollowHyperlink solve this problem?"

I'm confused. You say they added a few more records and give an example of adding more FILE names. Which is it?
Also, you ask would the FollowHyperlink solve... then you say you have it working. Which is it?

"The question now is, if my HypLnk field is lost, will my FollowHyperlink Button still be attached to it?"
What? If Hyplnk field is lost, then the button won't work because the code won't work. The code is attached to the button. Is that what you're asking?

You conclude that it is working now. I guess that's good.
 
My appologies fneily, I tend to get wordy when I don't know how to explain myself. But here are the answers to the questions.

"I'm confused. You say they added a few more records and give an example of adding more FILE names. Which is it?
Also, you ask would the FollowHyperlink solve... then you say you have it working. Which is it?"
They have added more records. Was trying to convey the location of the records and the file name.

"What? If Hyplnk field is lost, then the button won't work because the code won't work. The code is attached to the button. Is that what you're asking?"
Yes it is, and so I am back to square one in trying to keep the hyperlink active.

"You conclude that it is working now. I guess that's good."
Yes it is working, but I'm still needing to be able to keep the hyperlink up and working properly. That is not lose it when they add more records to the directory

Sorry for the confusion and I hope this clears things up.

To recap...
Problem: Hyperlink does not stay linked when records are added to same directory.

Solution: Create FollowHyperlink Button.

Status: FollowHyperlink Button is up and running.

Future Problem: Since Button is Tied to Hyperlink Solution will need to be reworked.

Thanks for your help and again, sorry for the confusion.

RobotMush (Technical User) Self Taught
 
I think I see. They add more records in a DIFFERENT file but still in the same directory.
You are storing these path names in a table.
So when they create a new file with new records, somehow you have to know and store that filename. Correct? If that's the case, can you tell your users to stop doing that and place all their records in one file?
Do they have a standard filename convention? If things are random, you're going to have to have them tell you the file names.
Or, create a form for the users where they can update the file name in the table. Then you don't need to worry about it.
I think.
 
I think I see. They add more records in a DIFFERENT file but still in the same directory."
Yes that is correct

"You are storing these path names in a table."
Yes, I am building a Table of the Hyperlinked Data

"So when they create a new file with new records, somehow you have to know and store that filename. Correct?"
Yes that is correct

"If that's the case, can you tell your users to stop doing that and place all their records in one file?"
No, my creating the Hyperlink is more for my benefit than the company. As I am the file clerk I feel I need to have a database to keep track of all the different records we have.

"Do they have a standard filename convention?"
Yes, although it is not fully utilized but it is...
Server\Drive\SubDirectory\ClientName\Department\Year\FileName.
However there are variations in that after ~\ClientName\ or ~\Department\ or ~\Year\ there are one or more subdirectories.

"If things are random, you're going to have to have them tell you the file names."
What I do is get a DOS printout of the Server\Drive\Directory\ contents. I'm using that now to get the hyperlinks setup. It is a few weeks old so it is already obsolete.

"Or, create a form for the users where they can update the file name in the table. Then you don't need to worry about it."
That would be good, but this is for my own need and not the company's

Hope that helps clear things up. If nothing else I am having frustratingly fun doing this as well as learning more about VBA and ACCESS database

Thank you for your help and suggestions.

RobotMush (Technical User) Self Taught
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top