Creating a hyperlink to Twitter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • franji
    New Member
    • Oct 2014
    • 2

    #1

    Creating a hyperlink to Twitter

    I'm creating a contacts database for a project I'm currently working on. I have added a field for contacts' Twitter username and set data type as hyperlink.

    I would like to make it so that people just have to enter the username (i.e. itvnews) rather than the whole URL (i.e. https://twitter.com/itvnews). But when it's clicked on, it will take you to the URL.

    I'm sure Access can do this, but I have no idea how to do it!

    Any help would be greatly appreciated.

    (I'm using Access 2007)
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3665

    #2
    The simplest method would be to concatenate the hyperlink prefix for the url with the value in the text box, and then execute the hyperlink:

    Code:
    Private Sub GoTwitter()
        Dim strLink as String
        strLink = "https://twitter.com/" & _
            Me.txtTwitterUserName
        Application.FollowHyperlink strLink
    End Sub

    Comment

    • franji
      New Member
      • Oct 2014
      • 2

      #3
      Hi

      Thanks for your help. I kept having issues when I was trying to click on the textbox (formatted as hyperlink) but all fixed when I changed it to text, and created a button to click.

      Thanks a lot :-)
      Fran

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3665

        #4
        glad we could be of some help.

        Comment

        Working...