hyperlink to files on the network

  • Thread starter szag via AccessMonster.com
  • Start date
S

szag via AccessMonster.com

I am looking for the best way to allow end users to create links to files on
the network. I have a table that has a hyperlink field and I am using that
field in a subform. What I would like is that when the field is empty and a
user clicks in the field it allows then to choose the file they want to link
to (I assume a dialog box would pop up). I know that the user can right click,
choose hyerlink, then edit a hyperlink but that seems very inefficient and
the user would have to be "trained" that they need to right click on the
field to even know it was an option.

Any help?
 
T

Tom van Stiphout

On Mon, 28 Dec 2009 20:36:06 GMT, "szag via AccessMonster.com"

But what if your server is replaced by another one (with a different
name)? You'll have all these records pointing to the old server. A
better approach may be to store (in a text field) the path relative to
some root folder. Then you can simply update the RootFolder variable
or table value, and the app continues to work unchanged.

-Tom.
Microsoft Access MVP
 
S

szag via AccessMonster.com

Probably makes more sense but could you provide a bit more detail on how I
actually accomplish this? If a user needs to create a link to the particular
file what is the set up? Thanks for the help.
But what if your server is replaced by another one (with a different
name)? You'll have all these records pointing to the old server. A
better approach may be to store (in a text field) the path relative to
some root folder. Then you can simply update the RootFolder variable
or table value, and the app continues to work unchanged.

-Tom.
Microsoft Access MVP
I am looking for the best way to allow end users to create links to files on
the network. I have a table that has a hyperlink field and I am using that
[quoted text clipped - 6 lines]
Any help?
 
T

Tom van Stiphout

On Tue, 29 Dec 2009 13:18:23 GMT, "szag via AccessMonster.com"

OK. Say that we keep the RootFolder value in a table tblSystemSettings
that has one row of information. In our startup code we can then call:
g_strRootFolder = DLookup("RootFolder", "tblSystemSettings")
'ensure trailing backslash for easy concatenation
if right$(g_strRootFolder) <> "\" then g_strRootFolder =
g_strRootFolder & "\"

This global variable has previously been declared in a standard module
(I call mine modGlobal):
global g_strRootFolder as string

You launch the FileOpen dialog with this code:
http://www.mvps.org/access/api/api0001.htm

When the user selects a file you will get the full path back. You copy
the file (using FileCopy) to the directory tree under the RootFolder,
and you save the relative path (= new path minus root folder path).

-Tom.
Microsoft Access MVP


Probably makes more sense but could you provide a bit more detail on how I
actually accomplish this? If a user needs to create a link to the particular
file what is the set up? Thanks for the help.
But what if your server is replaced by another one (with a different
name)? You'll have all these records pointing to the old server. A
better approach may be to store (in a text field) the path relative to
some root folder. Then you can simply update the RootFolder variable
or table value, and the app continues to work unchanged.

-Tom.
Microsoft Access MVP
I am looking for the best way to allow end users to create links to files on
the network. I have a table that has a hyperlink field and I am using that
[quoted text clipped - 6 lines]
Any help?
 
S

szag via AccessMonster.com

Sorry Tom - I am pretty much a beginner when it comes to VBA so I am
struggling with what to do per your instructions below. Would it be possible
to explain in a step by step approach or is that too time consuming?
OK. Say that we keep the RootFolder value in a table tblSystemSettings
that has one row of information. In our startup code we can then call:
g_strRootFolder = DLookup("RootFolder", "tblSystemSettings")
'ensure trailing backslash for easy concatenation
if right$(g_strRootFolder) <> "\" then g_strRootFolder =
g_strRootFolder & "\"

This global variable has previously been declared in a standard module
(I call mine modGlobal):
global g_strRootFolder as string

You launch the FileOpen dialog with this code:
http://www.mvps.org/access/api/api0001.htm

When the user selects a file you will get the full path back. You copy
the file (using FileCopy) to the directory tree under the RootFolder,
and you save the relative path (= new path minus root folder path).

-Tom.
Microsoft Access MVP
Probably makes more sense but could you provide a bit more detail on how I
actually accomplish this? If a user needs to create a link to the particular
[quoted text clipped - 14 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top