btgtech
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.Fi leSystemOb ject")
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
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.Fi
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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