Hyperlink Questions

ccondran08

Registered User.
Local time
Today, 18:59
Joined
Feb 27, 2014
Messages
58
Hoping someone can help me with this. I have set a field in my form to a hyperlink, the field is called 'EventID' and data in the field looks something like 'Event 12345'. I have put in the following on click event for the field ;

Private Sub EventID_Click()
Dim Audit As String

Audit = Right ("EventID",5)

Application.FollowHyperlink "http://dummylink.aspx?mode=view&QWEID=&Audit",,True
End Sub

What I am trying to do is when the user clicks on the hyperlink, it will use the last 5 numbers in the field (ie. 12345 from Event 12345) and then the 5 numbers will form part of the hyperlink ( = view&QWEID=&Audit" ) but it appears that the Audit reference ( Audit = Right ("EventID",5) isn't working. Does this need to be converted to an Integer first, if so how can I do this ? Any suggestions would be greatly appreciated.

The original hyperlink address is something like this : http://dummylink.aspx?mode=view&QWEID=12345
 
Last edited:
You need to refer to the field correctly and then concatenate the string for the link in the right fashion - something like
Code:
Private Sub EventID_Click()

    Dim Audit As String
    Dim sLink as String

    Audit = Right (Me.EventID,5)

    sLink = "http://dummylink.aspx?mode=view&QWEID=" & Audit 

    Debug.Print sLink

    Application.FollowHyperlink sLink,,True

End Sub
 
Brillant, worked like a charm.
 

Users who are viewing this thread

Back
Top Bottom