Hardcoding Network Path and extension for use with hyperlink

  • Thread starter Thread starter KFox via AccessMonster.com
  • Start date Start date
K

KFox via AccessMonster.com

I have a table with a file name field (for a pdf file), but the file name is
only the name of the field-- it doesn't include the network path of where the
file is stored, nor does it include the .pdf extension. How could I include
the network path and extension when setting up the code for this text so it
works as a hyperlink?

I haven't written any of the code yet, so not sure exactly how to even do
this. I need the field to remain a text field-- I can't change it to a
hyperlink format.

Thank you VERY much!

Kellie
 
Dim rs as DAO.Recordset
Dim strHyper as string
currentdb.openrecordset("Select filename from yourtable")
if rs.EOF then exit sub
rs.movefirst
strHyper = "//myserver/mydirectory/" & rs!filename & ".pdf"
followhyperlink strHyper

another option is to build a similar string from a form...with your table as
it's recordsource.
create an unbound textbox that builds the string
then on the click event of the textbox
use the FollowHyperlink command to launch your PDF.

J
 
Thanks "J"-- I'll give this a shot!

Kellie
Dim rs as DAO.Recordset
Dim strHyper as string
currentdb.openrecordset("Select filename from yourtable")
if rs.EOF then exit sub
rs.movefirst
strHyper = "//myserver/mydirectory/" & rs!filename & ".pdf"
followhyperlink strHyper

another option is to build a similar string from a form...with your table as
it's recordsource.
create an unbound textbox that builds the string
then on the click event of the textbox
use the FollowHyperlink command to launch your PDF.

J
I have a table with a file name field (for a pdf file), but the file name is
only the name of the field-- it doesn't include the network path of where the
[quoted text clipped - 9 lines]
 
J--
I'm struggling with this part of the code:

currentdb.openrecordset("Select filename from yourtable")

The name of the field on my form is "CertHolder". And the name of my table
is "tblIssued". Do I use these fields somewhere between the parenthesis
above? I'm unclear of the proper syntax.

TIA!
Kellie
Dim rs as DAO.Recordset
Dim strHyper as string
currentdb.openrecordset("Select filename from yourtable")
if rs.EOF then exit sub
rs.movefirst
strHyper = "//myserver/mydirectory/" & rs!filename & ".pdf"
followhyperlink strHyper

another option is to build a similar string from a form...with your table as
it's recordsource.
create an unbound textbox that builds the string
then on the click event of the textbox
use the FollowHyperlink command to launch your PDF.

J
I have a table with a file name field (for a pdf file), but the file name is
only the name of the field-- it doesn't include the network path of where the
[quoted text clipped - 9 lines]
 
Never mind-- I figured it out.

Thanks again!!
J--
I'm struggling with this part of the code:

currentdb.openrecordset("Select filename from yourtable")

The name of the field on my form is "CertHolder". And the name of my table
is "tblIssued". Do I use these fields somewhere between the parenthesis
above? I'm unclear of the proper syntax.

TIA!
Kellie
Dim rs as DAO.Recordset
Dim strHyper as string
[quoted text clipped - 17 lines]
 
Back
Top