Sometimes it is the little things that cost more time to sort out!
On our works Access DB I created, I have a hyperlink within a table that shows on a form. This hyperlink takes the user to the folder on our server that contains all the documents relevant to the project displayed on the form.
When the user adds a new record, (a new project), the hyperlink field correctly displays: \\HPSERVER\TFS\2010
The user then fills in the project details and then right clicks on the hyperlink and changes the hyperlink to match the new project, ie: \\HPSERVER\TFS\2010\The Old Rectory
This is my problem:
When a new record is selected, if you click on the hyperlink \\HPSERVER\TFS\2010, nothing happens. The reason is that the hyperlink field has nothing in the address box, (if you right click the hyperlink, select hyperlink, then edit hyperlink, a window pops up where the 'Text to display' and 'Address' can be entered, only the 'Text to display' is entered as this comes from the table I set up.)
How do I set the address to be the same as the display attribute when a new record is set up.
Of course, the users can navigate to the server, but the hyperlink is better.
Finally, there is also a field called 'Project Name'. When the new record is set up, a folder is also set up manually to match the project name. Is it possible to make the hyperlink to this folder automatically set itself to the correct folder. For example, when the Project Name is filled in and the focus is lost to this field, a piece of code automatically runs that changes the hyperlink to \\HPSERVER\TFS\2010\new project name, and then the codes actually makes the new folder?
Hide the control holding the actual hyperlink data. Use an unbound control to operate the link. You set the new control as a hyperlink type and use code in the oncurrent event to place the value in the unbound control. when adding a new record, use Me.Refresh.
The user doesn't need to see the actual hyperlink value, but rather an indication of whether or not there is a link.
I like using this as the control source for the visible control:
=IIf(Nz([NetworkLocation],"")="","Assign location ...","Click to Open")
Then, I use code to decide what to do when the control is clicked. For example, if the NetworkLocation field is blank, the code will use a file dialog to allow the user to select a location (and it uses a particular location as the start point).