Hyperlink? (1 Viewer)

L'apprentis

Redcifer
Local time
Today, 08:26
Joined
Jun 22, 2005
Messages
177
I have created a very simple code to fill automaticly an hyperlink field when a text box is updated on a form:

Code:
Me.txtHyperlink = "F:\Data\CPP\CPP PDF\" & [TxtPipeSize] & "\" & [DrawingFile] & "\" & [PartNumber] & ".sht" & [TxtSheetNo] & ".Rev" & [TxtRevNo] & ".pdf"

TxtHyperlink is bound to the hyperlink field, when the code is executed the Hyperlink field is filled with the right address. but I think the code just fill the text to display "parameter" of the hyperlink field and not the actual adddress.
what should I do to get the result of the function to be saved as the Hyperlink address?
 

Bat17

Registered User.
Local time
Today, 16:26
Joined
Sep 24, 2004
Messages
1,687
You need the # to seperate name from address, try
Me.txtHyperlink = "[PartNumber] & ".sht" & [TxtSheetNo] & ".Rev" & [TxtRevNo] & ".pdf#F:\Data\CPP\CPP PDF\" & [TxtPipeSize] & "\" & [DrawingFile] & "\" & [PartNumber] & ".sht" & [TxtSheetNo] & ".Rev" & [TxtRevNo] & ".pdf#"

HTH

Peter
 

L'apprentis

Redcifer
Local time
Today, 08:26
Joined
Jun 22, 2005
Messages
177
Thanks again for your help,
You are correct : Hyperlink = DisplayText#Address#
 

Zanatos

New member
Local time
Today, 08:26
Joined
May 29, 2007
Messages
7
Hey guys,
I am experiencing the same problem that L'apprentis was facing, and upon trying your solution I have stumbled across an error of my own.

First of all, I am new to Access, I have this in my VB code, but don't if that's where it's supposed to be or if I wrote the Macro correctly.

Here's what I have:

Private Sub Hyperlink()
MyHyperlink = "[InspectionDocID]& ".pdf#Z:\Chris Sanders\Access\" &[InspectionDocID]& ".pdf#"
End Sub


The second I click off of it this happens:

Compile Error: Expected: End of Statement
Private Sub Hyperlink()
MyHyperlink = "[InspectionDocID]& ".pdf#Z:\Chris Sanders\Access\" &[InspectionDocID]& ".pdf#"
End Sub

The error highlights the . at the first ".pdf#Z:..."

Any ideas as to where I went wrong?
 

Users who are viewing this thread

Top Bottom