A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hyperlink to a file



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2008, 06:06 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 24
Default Hyperlink to a file

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.
  #2  
Old May 5th, 2008, 02:37 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Hyperlink to a file

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
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

wrote in message
...
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.



  #3  
Old May 6th, 2008, 03:57 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 24
Default Hyperlink to a file

Thank you
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.