Hyperlink to open doc.

mtagliaferri

Registered User.
Local time
Today, 15:59
Joined
Jul 16, 2006
Messages
550
I have the following code to open a specific file:
Code:
Private Sub OpenDoc_Click()
FollowHypelink "C:Documents.......
End Sub
The name of the file is written in the code, for every record on my form I have a different file to open so I have a field called "DOCN" wich is the name of the file I have to open. How can I put a extension on the code to read the file name mentioned in the field on my form?
Thanks
Marco
 
Are you looking for:

Private Sub OpenDoc_Click()
FollowHypelink "C:\Documents.......\" & me.docn.text
End Sub

I wouldn't hard code paths, you'll come to regret it. Or at the very least declare a global constant so you only have to change it one place.
 
:( it does't work, the file I want to open is a pdf format it is in a folder named Hotac Bills therefore my code is:
Code:
Private Sub DocN_DblClick(Cancel As Integer)
FollowHyperlink "C:\Documents\Archive\Hotac Bills" & Me.DocN.Text
End Sub
What am I getting wrong?
 

Users who are viewing this thread

Back
Top Bottom