Links

Here's an example i made for someone on another forum.

It does not store the path to any files.
when the database is opened it creates a folder named Clients in the same folder as the database.
When you enter a new client and open the client form, it will create a folder for that client within the Clients folder.
When you save a file for a client you save it to their particular folder.

When you open the client detail form, a procedure runs which lists all the files in that folder in a listbox. Double clicking the list will open the file.

So long as the Clients folder and the subfolders are in the same folder as the database you don't have to store any file paths.

note that in the demo if you use the get file button to add a file it is copying the file to the folder as opposed to moving it to the folder so deleting it won't delete the original file.
 

Attachments

I presume now that you mean that the hyperlinks won't work. Your original question and some of the earlier answers were about this exact problem. If the hyperlinks to the files (after migration) won't work, you need to update those links.

I'm trying to decide if there is a predictable pattern to this move so that you could just run an update query. But that might not be quite so easy if the migration pattern wasn't carefully followed.

According to post #19, your DB is working correctly. So are you planning to move the PDF files again? Or did you just move the DB and not the PDF files, so that the hyperlinks still point to the original location? I am still somewhat confused regarding your intention here.
moving both database and pdf files. all files go together. in this case almost everything same only drive different. first time when i lost hyperlinks folders were changed. this time it wont be the case. just different drives.
 
Here's an example i made for someone on another forum.

It does not store the path to any files.
when the database is opened it creates a folder named Clients in the same folder as the database.
When you enter a new client and open the client form, it will create a folder for that client within the Clients folder.
When you save a file for a client you save it to their particular folder.

When you open the client detail form, a procedure runs which lists all the files in that folder in a listbox. Double clicking the list will open the file.

So long as the Clients folder and the subfolders are in the same folder as the database you don't have to store any file paths.
i have to test it first. will inform you after that.
 
actually i tried it and works. links are ok. but still if folder is changed links wont work. what should be done in such case.
Don't change the path?
If the path changes, you will need to update your links for the part of the path that changes.
To mitigate this, you could save the portions of your path in a self referencing file and build the path at run time. Sounds like a lot of extra work rather than just "Don't rename directories".
 
How about just hiding the files/folders? :(
why? what I will get if I do that. With each new record there is a new document to scan which means new pdf file. so i put new pdf file in the same or new folders.
 
Last edited:
Well if the users cannot find them, except through your dB, then they cannot move them?
If ANYTHING/ANYONE moves the files, it would be up to you to find them again?

Hardly rocket science?
 
Well if the users cannot find them, except through your dB, then they cannot move them?
If ANYTHING/ANYONE moves the files, it would be up to you to find them again?

Hardly rocket science?
No need for that because I am the only user. last time aplication worked only for one year. I made changes to work with additional years so the old organization of folders have to be changed. at that time i didnt know that i will broken links that way. so now just in case i want to know if something similar happen how to fix the problem without making new links (repairing them one by one).
 
How many records do you need updated?
If a small number, I'd suggest manually as it will be fastest.
 
How many records do you need updated?
If a small number, I'd suggest manually as it will be fastest.
it is not small number manually can be than but it is to much time consuming. there was a link i don't remember where exactly for checking and repairing hyperlinks but link is dead now ( probably too old)
 
Are those links stored in a hyperlink field? If so, I would suggest moving them to a plain text field first, then it should be easier to handle broken links later.
 
Are those links stored in a hyperlink field? If so, I would suggest moving them to a plain text field first, then it should be easier to handle broken links later.
let me see if understood well. first to change hyperlink field to text than to make query to make desired changes and last to back field from text to hyperlink again. if this is correct i can do it. problem solved.
 
let me see if understood well. first to change hyperlink field to text than to make query to make desired changes and last to back field from text to hyperlink again. if this is correct i can do it. problem solved.
Close but not quite. I'm suggesting to convert the hyperlink to plain text and leave it as plain text, so you don't have to do this exercise again the next time you move the stick to another computer.
 
No need for that because I am the only user. last time aplication worked only for one year. I made changes to work with additional years so the old organization of folders have to be changed. at that time i didnt know that i will broken links that way. so now just in case i want to know if something similar happen how to fix the problem without making new links (repairing them one by one).
So a simple replace would suffice. Supply the old path and then the new path? Replace one with the other.
 
let me see if understood well. first to change hyperlink field to text than to make query to make desired changes and last to back field from text to hyperlink again. if this is correct i can do it. problem solved.
I think your missing the point to NOT use hyperlink datatype. If you must store the full path to a file then just store the path as text in a text field. You can then use vba to open the file as if it were a hyperlink.

If you keep the files in folders in the same folder of the database you can always find the root path to that folder using CurrentProject.Path.

in the immediate window put the following..

Code:
?CurrentProject.Path
That will show the path to the database folder. Then you can concatenate the rest of the path to that like
Code:
CurrentProject.Path. & "\MyPdfFolder\1234.pdf

As far as coming up with code to "fix" your hyperlinks I think we need to know a lot more about your file and folder structures and naming conventions.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom