Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Unanswered: I want pasted url's in "text" data fields to be hyperlinked

    Basically I have a few tables in my database. In these tables I have some fields which are set to the "text" datatype. However, I want to be able to paste url's into these cells and have it hyperlink those urls automatically. This way I can simply click on the hyperlink and it opens them.

    As it stands right now, it does not hyperlink the pasted text because the fields are set to "text" . If I change datatype to hyperlink, then I can't put normal text into it.

    So please tell me if there's a way to do this.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Can you show some data examples of what is stored in this text based URL field?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I usually had 2 fields in the table, one which showed the "normal text" value and the other which was the hyperlink datatype field.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You can add the hyperlink at runtime, i.e. when displaying the data on the form.
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2008
    Posts
    2
    Quote Originally Posted by StarTrekker
    Can you show some data examples of what is stored in this text based URL field?
    I have approx. 100 tables in total (in 3 groups). Most of the tables are empty and untouched - I've only named the tables so far. I want to be able to enter text in the cells, but sometimes I want to be able to paste url's which are hyperlinked, thus allowing me to simply click on the links to open them. So basically, I want to have both options available - text and hyperlinked url's.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Why? Why not have two separate fields... one text field for the general text, one hyperlink for the URL's?

    I would also be checking your design. I get the impression that you don't need 100 tables.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151
    PKStormy is correct. I think the best way is to have 2 fields on the form. One is text that is set to the data in the table, and the second is simply a label/text field. Use the following code to show the real hyperlink.

    Private Sub Form_Current()

    Dim sLinkAddress As String

    ''FacilityHyperlink is the text/label on the form and WebAddr is the column in
    ''the table
    Me.FacilityHyperLink.Caption = Nz(Me.WebAddr, "")
    If Not IsNull(Me.WebAddr) Then
    sLinkAddress = Me.WebAddr
    Me.FacilityHyperLink.Hyperlink.Address = sLinkAddress
    '' makes the label 'raised' to appear as a button
    Me.FacilityHyperLink.SpecialEffect = 1
    Me.FacilityHyperLink.Visible = True
    Else
    Me.FacilityHyperLink.Visible = False
    End If

    End Sub
    --If its free, take it for what its worth!

Posting Permissions

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