Hyperlinks

M

Matt

I have created some code in a form to create folders on a server and saves
hyperlinks to the locations of the folders in a field in the tblJobs table.
(full code below)
eg when the button is press for a record it takes the job number field value
001 and the job name value JobOne and creates a folder on the server and
creates a hyperlink to that folder in a field wpPath. If you were in the 002
job number record and pressed the button you would get see below
\\server1\001_JobOne
\\server1\002_JobTwo

I want to able to move this database and the associated folders to different
locations, because the server1 path is hard coded into the hyperlink address,
once the database and associated folders are moved the hyperlink address will
fail. My question is this, can I use a value instead of the myServer =
"\\Server1" (full code below) that points to a field in a different table
that holds the server name so that if the database location is changed I only
need to change the value in the one table not all the records in the tblJobs
table which is around 5000 at present.

Thanks

Matt

Dim myFolder, myServer
Dim myHyper1, myHyper2

myFolder = Me![txtJobNumber] & "_" & Me![txtCustomerName]
myServer = "\\Server1"

MkDir myPath & "\" & myFolder
myHyper1 = HyperlinkPart(myFolder, acDisplayText)
myHyper2 = HyperlinkPart(myServer & "\" & myFolder, acDisplayText)
Me.wpPath = myHyper1 & "#" & myHyper2
 

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

Similar Threads

hyperlink fields 1
Moving Folders 1
Range.Find problem 3
Hyperlinks 3
Getting hyperlink field to work 0
Access 2010 Disable Microsoft Access Security Notic 3
Hyperlinks 0
Hyperlink Overwritten problem! 0

Top