Link to home
Start Free TrialLog in
Avatar of btgtech
btgtechFlag for United States of America

asked on

Hyperlinks in Access Table

We currently have a hyperlink field in a Microsoft Access 2013 Table.  

To populate the field, we have the following code:

    Dim filesys
    Dim FromPath1 As String
    Dim ToPath1 As String
   
       
    If Len(Dir("T:\Completed Jobs Library - New System\" & [QuoteID], vbDirectory)) = 0 Then
        FromPath1 = "T:\Completed Jobs Library - New System\Master Job Folder"
        ToPath1 = "T:\Completed Jobs Library - New System\" & [QuoteID]
        Set filesys = CreateObject("Scripting.FileSystemObject")
        filesys.CopyFolder Source:=FromPath1, Destination:=ToPath1
       
    End If
   
    Me.DocumentLink = "C:\Completed Jobs Library - New System\" & [QuoteID]


I then have an on click event for the field on the form:
    If Me.DocumentLink Is Not Null Then
        Shell "C:\WINDOWS\explorer.exe """ & Me.DocumentLink & "", vbNormalFocus
    End If

I placed this on the server and now we receive the following error(See Attached "Error on Server")

Thoughts?
Error-on-Server.png
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of btgtech

ASKER

This is a button within a form on in an Access app on a server.

The button is intended to create the directory to save the job documentation to.

There is already a master folder which we are making a copy of in the code and then assigning the link to the hyperlink field.

I will definitely try the FollowHyperlink method.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial