Dynamic Hyperlink Base

User33

New member
Local time
Today, 15:52
Joined
Aug 2, 2005
Messages
9
I am looking to basically update the hyperlink base every time the database is opened to be the folder that the database is currently in.

We are trying to make the database and supporting information portable, so that people can copy the entire folder anywhere on their computer and all of the links will still work. I can't put all of the info in the database because we are already pushing the size limit.

I would like to keep it from getting terribly complicated, as others will have to update this database with more info in the future and make the links themselves.

If there is a better or different way of getting the same result without going through the hyperlink base, that is fine.

Any help would be appreciated.

Thanks.
 
Turns out I don't have it figured out. Just a coincidence had me thinking I was smarter than I am.

My original question still applies.

Thanks.
 
Well, if you only have the filenames in the table then putting them together with CurrentProject.Path & FileName should make it portable, assuming all of the files are in the same folder as the mdb. Or did I misunderstand your original question?
 
Last edited:
I think you are understanding my original question, but you may be overestimating my experinece/existing knowledge.

I just have a table that has two columns with a bunch of blank entries. I would like to put hyperlinks in those blanks that link to specific information stored in the same folder (or subfolders of the same folder) that the database is in.

I am unclear as to where I am supposed to be putting the CurrentProject.Path & Filename. In the past I have added hyperlinks using right click, hyperlinks, edit hyperlink and browsing for what I was looking for.

Thanks for the help so far.
 
User33 said:
so that people can copy the entire folder anywhere on their computer and all of the links will still work.

Might I ask why you are copying to local hard drive?
 
Hi User33,

Maybe I should ask how much of the system you have completed so far. Is the Hyperlink Base that you spoke of a table within your database? Do you have any code samples that demonstrate how it is currently being used that I might review and offer suggestions on how you could make it more portable?
 
jrjr:
Making it possible to copy to a local hard drive for use on laptops when on travel, people are going to need to work from home, taking the database to other sites, etc.

RG:
The hyperlink base is not in a table. It is a standard feature or value or whatever that comes with access. If you go to file, database properties, summary tab, it is at the bottom. It allows you to basically use the same first part of the path for all hyperlinks. That way if the folder where all of the information is stored is moved you only have to update that one value and all the hyperlinks will still work.

I don't have any code for the hyperlinks. I've been adding them with full addresses by simply browsing for them in the edit hyperlink menu.
 
Maybe this will help,

If you store all of your documents in the same folder as your database, then just put the file name in for the hyperlink.

Eg.
Word doc..... file name is - something.doc
In the hyperlink criteria simply put - something.doc
When clicked it will look in the current folder.

As long as the DB and the docs remain in the same folder you can move that folder anywhere you wish.
 
Hi User33,

Thanks for the reply; I learn something new every day. I love this job! :D I'll look at the hyperlink stuff and post back. Meanwhile it looks like jrjr might have a useful post.
 
Actually I was just playing around with this. I found that if you place your doc in a subfolder of the DB folder then you can still reference it locally.

For instance...

Sub folder of the DB folder.... name it subfol (or whatever you want)

In the hyperlink address place:

subfol/something.doc

it seems to work ok, I had never tried this before :)

That will let you sort your docs by whatever criteria you want by making a folder for each type of document. Just keep them as subs of the primary DB folder and you can move them where you want or need. Makes for a longer copy process though if you have large files, but if they have to be portable, you will need to copy them anyway.

Rural Guy - this stuff is fun!!
 
Last edited:
I have actually been playing around with that for the last few minutes. It seems to work and takes me to the correct location even if I move stuff around. It has, of course, led to another wrinkle.

Now when I click on the hyperlinks it gives me a warning message stating that I should be sure I want to open the hyperlink, hyperlinks can be damaging to my computer, etc. It didn't used to do that when I was using the full path. I tried to disable that using the DoCmd.SetWarnings False, but that didn't work for me. Any ideas how to beat this one?

Thanks for the considerable help so far. Much appreciated.
 
You can use the Shell() function to open a file. I like to use the ShellExecute method to open files.

Pay attention to the ShellExecute method I am using to open a file in my
Browse [Find a directory or file] sample.
 
Last edited:
Ok then. It doesn't look like I'll be able to disable that automatically on everyone's computer who might be using this tool. I think I'll quit while I'm ahead. People will just have to click Yes.

Thanks again for all the help.
 
User33 said:
Ok then. It doesn't look like I'll be able to disable that automatically on everyone's computer who might be using this tool. I think I'll quit while I'm ahead. People will just have to click Yes.

Thanks again for all the help.
WHY?

The Shell() function and the ShellExecute method I mentioned above will prevent it. Why not make your application behave as professional and user friendly as possible?
 
Because people other than myself will be adding new info and links to this database. They will not have the desire or the knowledge to go into VB and add the shell funtion for every new file and related link they want to add.

I have used the shell function in other parts of my file where other people don't need to be concerned with it. I just don't think it is the best route for this task. I appreciate making it as "professional and user friendly as possible," but making it more difficult for people to add appropriate info and links is not that.

Again, thank you everybody for the very useful help.
 
You would not have to add the shell function for every new document. What I could visualize is your users dropping any new documents into the corresponding folder. Then in your DB you could have a list of documents that are available. Your user would add their new document to the list and not have to add a link. When someone wanted to open a particular document, the list page would contain only one button which would execute the shell function and they would simply navigate to the document that they want.

Just wanted to share the idea... the shell function does work well.... But the choice is yours
 

Users who are viewing this thread

Back
Top Bottom