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