Results 1 to 3 of 3
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Going to a URL (2003)

    I have two fields in a table that contain URLs associated with various records. Field1 contains the URL as a Hyperlink, Field2 contains it as text.

    When I click cmdURL, I want my browser to open and go to the URL for the current record.

    I can't figure out how to do this (but I CAN go to a URL that I use the Properties sheet to set as the HyperlinkAddress property of cmdURL).

    Any suggestions?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Going to a URL (2003)

    You can use the FollowHyperlink method of the Application object, with the value of the text field as argument:

    Private Sub cmdURL_Click()
    Application.FollowHyperlink Me.Field2
    End Sub

    If you put a text box bound to Field1 on your form, you don't need a command button, since the user can click the text box to open the URL in the browser.

  3. #3
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Going to a URL (2003)

    It works! Thanks.

    I knew about the text box technique, but I didn't necessarily want users to see the url, to have a text box clutter up my form, etc.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •