Hyperlink from Field

dazstarr

Registered User.
Local time
Today, 18:33
Joined
Mar 19, 2007
Messages
132
Hi

I have been searching around the forum but havent stumbled across the answer.

I have a form which has a field called ContractNumber.

I would like a hyperlink which would open a document with the same name as the contract number.

Example: If the field has 123, I would like to open C:\StaticAddressFolder\[ContractNumber].doc

Can someone tell me if this is possible? Even better would be to work this off a command button?

Many Thanks
Daz
 
You can create a command button and do something like below on a command button's click event.

Dim strDocName As String
strDocName = Me.txtDocName
FollowHyperlink "C:\Access1\" & strDocName & ".doc"
 
Cheers Datagopher.

Worked a treat!

:)
 
It may pay to put all the Address information into strDocName as I noticed that in 2007 it is not very happy particularly with some characters in the AddInfo. I'm now in the habit of constructing Addresses as:

Code:
    With CodeContextObject
        Dim WebLink As String
         WebLink = "Artists_Biographies.aspx?Artist=" & .[Artist] & "&BType=S&BStyle=P" & ""
        Application.FollowHyperlink WebLink, , True
        HideWebToolBar
    End With

I construct a Get[Web]Path so it is declared only once.

Simon
 

Users who are viewing this thread

Back
Top Bottom