Results 1 to 3 of 3

Automatically reference records primary key in a hyperlink

  1. #1
    jbr87 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    14

    Automatically reference records primary key in a hyperlink

    So I have a DB that is used to track jobs with the job # being the primary key in the following format 2001-45 for example 2001 being the year of the prject and 45 being the 45th job of that year. In the record I'd like to link to project documents like drawings and such.

    Now the plan is to have all the jobs files store on a network drive with a standardized file path format eg \\pdserver\folder1\2001-45\drawings with the only changing variable being the job number (records primary key). Is it possible to have the hyperlink feild automatically point to the file address without the user manually searching through the file tree? Can the job number be a linked variable in the hyperlink address?

    I tried putting this as my default value for the feild \\pdserver\folder1\[Job Number]\drawings but all I get is a -1 value in the field not thwe actual link

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    This is how I would do it. I would NOT store the value as a hyperlink but instead use code in the click event of the control which displays the primary key to build the link:
    Code:
    Dim strLink As String
     
    strLink = \\pdserver\folder1\ & Me.JobNo & "\drawings
    FollowHyperlink strLink
    Something like that.

  3. #3
    jbr87 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    14
    Quote Originally Posted by boblarson View Post
    This is how I would do it. I would NOT store the value as a hyperlink but instead use code in the click event of the control which displays the primary key to build the link:
    Code:
    Dim strLink As String
     
    strLink = \\pdserver\folder1\ & Me.JobNo & "\drawings
    FollowHyperlink strLink
    Something like that.
    That was the solution I came up with as well, but I created a button in a form to do the same.

    Not only does it do what I would like it to it saves space and eliminates user input errors.

    thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Setting Reference Number for records
    By ankash in forum Programming
    Replies: 1
    Last Post: 07-12-2011, 05:12 AM
  2. automatically add records to linked table
    By bcrozier in forum Database Design
    Replies: 3
    Last Post: 04-07-2011, 08:03 PM
  3. Replies: 1
    Last Post: 08-03-2010, 12:33 PM
  4. Change linked table reference automatically
    By kjuelfs in forum Access
    Replies: 1
    Last Post: 07-20-2010, 08:14 AM
  5. Replies: 2
    Last Post: 09-10-2009, 07:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums