Results 1 to 2 of 2
  1. #1
    riffraff_ashraf is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Sep 2010
    Posts
    1

    Post Open up url page hyperlink not working!


    Hi, i am new to Vb and i am trying to get a field in my table to open up as a hyperlink once it is clicked. i have the following code:

    Private Sub lblReference_Click()
    Dim strLinkUrl As String
    Dim strPath As String
    Dim strName As String

    strName = lblReference.Text
    strPath = "http://helpdesk.travel.com/tickets/"
    strLinkUrl = strPath & strName

    Me.lblReference.Hyperlink.Address = strLinkUrl
    End Sub

    the data lblReference text field is a 5 digit number e.g. 12345 so i want to be able to go to the following address when i click on the lblReference field: http://helpdesk.travel.com/tickets/12345


    however when i try to i get the following error:

    run time error: '7980' the HyperlinkAddress or HyperlinkSubAddress property is read-only for this hyperlink.

    can anyone advise me in simple terms what i am doing wrong and what i am supposed to be doing please?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    I'm not sure why that code doesn't work, for some reason Access seems to have a problem with Hyperlinks sometimes.

    You can get around the problem by assigning it in the Object's .Value Property like so:

    Code:
    Me.lblReference.Value = Me.lblReference.Value & "#" & strLinkUrl
    Basically, you just append a hash (#) to the end of your Value, followed by the URL.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2010, 11:06 AM
  2. Page break on report inserts empty page between
    By Galadrielle in forum Reports
    Replies: 0
    Last Post: 07-07-2010, 04:18 AM
  3. Replies: 1
    Last Post: 05-22-2010, 08:30 PM
  4. Replies: 0
    Last Post: 02-11-2009, 06:43 PM
  5. Open a form from a web page
    By Karyn-2000 in forum Programming
    Replies: 0
    Last Post: 04-21-2006, 07:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums