Results 1 to 3 of 3

Thread: Hyperlink

  1. #1
    Join Date
    Jul 2009
    Posts
    38

    Unanswered: Hyperlink

    Hi All,

    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?

    Thanks

    Nige

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    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:
    Code:
    =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).
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  3. #3
    Join Date
    Jul 2009
    Posts
    38
    Tcace,

    Thanks for the info. Got it working now.

    Nige

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •