Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Hyperlink to a file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nybaseball22@gmail.com - 04 May 2008 18:06 GMT
Hello.  I am trying to setup a command button on a form that will
allow me to assign a hyperlink that will automatically open a file
(word, excel, pdf, etc) when I click on it.  However, I am unsure how
to setup the code that will allow me to create the hyperlink.  So far,
I have a field (FileHyperlink) in my table (ExpensesMain) that is
setup as a hyperlink field.  Is there a way to have a command button
open up a dialog box that I can search for the file I want to assign,
select it, and have it assigned to the tect box on my form (Text box
name: txtFileHyperlink - Form Name: ExpensesDetail)?

Thank you.
Arvin Meyer [MVP] - 05 May 2008 02:37 GMT
Just a regular textbox, holding the full path to the file. In a form, refer
use code like:

Private Sub cmdHyperlink_Click()
Dim strPath As String
If Not IsNull(Me.txtBoxName) Then
   strPath = Me.txtBoxName
   Me.cmdHyperlink.HyperlinkAddress = strPath
End If
End Sub
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Hello.  I am trying to setup a command button on a form that will
> allow me to assign a hyperlink that will automatically open a file
[quoted text clipped - 7 lines]
>
> Thank you.
nybaseball22@gmail.com - 06 May 2008 15:57 GMT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.