Results 1 to 5 of 5
  1. #1
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61

    > Please Help - Hyperlink Tables Not Working, Access 2010

    I have a simple form.

    One text field box
    One button (with macro)

    Actions:

    The User enters the file name for example: "1"

    the enter button concatenate the address to the file name and also enters the address to the table.
    When I go to the table the Hyperlink does not work. The type on the table field is Hyperlink and it still does not work.


    The cursor changes to a hand button the hyperlink actions does not process.
    The only time it works, I have to manually go to the table and delete a character and re-enter it back then press enter.

    I do not know why it does not work.
    Please see attachment

    Desktop.zip

  2. #2
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    For hyperlink field to work, string has to be in proper format:
    Code:
    Descriptive text#Link#
    So in your case:
    Code:
    C:\Users\NAME\Desktop\Place\1.pdf#C:\Users\NAME\Desktop\Place\1.pdf#
    Change your button code to:
    Code:
    Private Sub Command2_Click()
    Dim sSql As String
    Dim X As String
    Dim B As String
    Dim C As String
    B = "C:\Users\NAME\Desktop\Place\"
    C = ".pdf"
    X = B & Me.Text0.Value & C
    X = X & "#" & X & "#"
    sSql = "INSERT INTO HLinkTable ([AddressF]) VALUES ('" & X & "')"
           Debug.Print sSql
           CurrentDb.Execute sSql, dbFailOnError
           'FollowHyperlink X
    Me.Text0.Value = ""
    End Sub

  3. #3
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61
    Wow....That piece of the code blew my mind. If you have the time, can you explain how that work? : X = X & "#" & X & "#"



    But Million thanks anyway.

    Alphix

  4. #4
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    It simply concatenates your previously assigned X value (string) with itself and creates a new string for X. Nothing extraordinary.

  5. #5
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61
    Many thanks again :-)

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

Similar Threads

  1. Replies: 1
    Last Post: 12-27-2014, 12:38 PM
  2. Replies: 2
    Last Post: 08-22-2014, 12:02 PM
  3. Replies: 1
    Last Post: 05-24-2013, 12:05 AM
  4. Access 2010 and HyperLink to Folder
    By grapin in forum Programming
    Replies: 4
    Last Post: 04-13-2012, 01:07 PM
  5. Access 2010 and form hyperlink
    By grapin in forum Programming
    Replies: 2
    Last Post: 03-22-2012, 01:11 PM

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