Results 1 to 7 of 7
  1. #1
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32

    Angry Add button to follow hyperlink in table


    I am using Access 2010. I have a table with a hyperlink field that links to a word document. I have a form that references back to a query on that table. As I go through on the form to each new record and see the data, I also want the user to have the option to click a view/print button that will follow the hyperlink to the Word document. Seems easy, but I can't find a good way to accomplish this. I usually use macros to accomplish such tasks, but I am not finding anything. I'm not much for VBA code, but could use it if it works. Please help!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    In this case, the form field contains a path (it's just a text field, not a hyperlink field):

    Code:
    Private Sub txtAttachment_DblClick(Cancel As Integer)
         Application.FollowHyperlink Me.txtAttachment
    End Sub
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32
    So does that mean I need to change the field to text from hyperlink? I tried the code, but it kept giving me errors.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I'm not sure; I've never used the hyperlink field (don't like it for some unknown reason). Isn't the user just supposed to be able to click on the field data to open it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32

    Talking

    I figured it out. just like you said, change the field in the table to text and enter the hyperlink address in there. Then create the button and put in the VBA code:

    Private Sub Command24_Click()
    Application.FollowHyperlink ["enter control name here"]
    End Sub

    And that's all it took. I knew it would be easy if I could just get my brain working. Thanks for the input.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Glad you got it working!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    ma t is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    8
    Hello- I am trying to use followhyperlink as well- I am trying to use it to open a link in a browser to a file in dropbox. I have a form with a control, the control is named LimkToDoc it's record source is a text field in a table. The file path in the table is similar to https://www.dropbox.com/s/7u88x58dbi...ral_FID69.docx. I am getting run time error 15, cannot open the specified file. Does anyone know if this is possible? Thank you very much in advance!

    Private Sub cmdOpenFile_Click()
    Application.FollowHyperlink Me.LinktoDoc
    End Sub

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

Similar Threads

  1. Replies: 12
    Last Post: 12-14-2011, 08:04 PM
  2. Replies: 4
    Last Post: 01-31-2011, 03:19 PM
  3. Command button as a Hyperlink
    By Alaska1 in forum Access
    Replies: 3
    Last Post: 10-21-2010, 02:08 PM
  4. hyperlink data not transferring to destination table
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:12 PM
  5. FOLLOW UP DATABSE
    By gab_esp in forum Database Design
    Replies: 2
    Last Post: 07-19-2006, 11:27 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