hyperlinks

paulevans

Registered User.
Local time
Today, 15:19
Joined
Mar 7, 2006
Messages
79
Help please. I would like to be able to create a browse button that will allow the user to find a file that when they click ok on the browse window is assigns the file to a hyperlink .

I have used the following code to open a dialog box which works fine and puts the file name in the hyperlink field on my form however when I click the hyperlink nothing happens.

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)


Me![txtFile] = strInputFileName

any ideas
 
Go to the Click event of the text box [txtFile] and add in the
Code:
If Not IsNull(Me.txtFile) And Me.txtFile <> "" Then
   FollowHyperlink Me.txtFile
End If

The first part is so that it doesn't try to go to the hyperlink when you click in the empty box to add it.

The drawback is that once you've entered the data it won't let you click in it without going to the link. You can if you tab into the field.
 
Hi Bob thanks for that was what I was looking for. The only problem I have with this is that it open the hyperlink in the background and not in the front.

Paul
 
do you have your form set as "popup?" If so, you need to change that to No.
 
No both master and sub form are set to popup no
thanks
 

Users who are viewing this thread

Back
Top Bottom