Auto-generate hyperlinks to external pdf files using data in a separate field

  • Thread starter Thread starter sandrakhoo
  • Start date Start date
S

sandrakhoo

I have a field containing numbers, I want to create a hyperlink field that
could pick up those corresponding numbers and link to an external folder with
pdf files named number.pdf. Do I have to write an expression in the new field?
And how?

Any suggestions?
 
Hi Sandra,

You don't even need a hyperlink field. If you have a form with a textbox
named txtFileNumber bound to the field with the file numbers, you can
just add a commandbutton and put something like this in the button's
click event procedure:

Const PDF_FOLDER = "D:\External Folder\"

If Not IsNull(Me.txtFileNum.Value) Then
Application.FollowHyperlink PDF_FOLDER & Me.txtFileNum.Value _
& ".pdf"
End If
 
Back
Top