Results 1 to 15 of 15
  1. #1
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31

    button hyperlinks


    I have inserted a command button into my form and want it to follow a hyperlink that is stored in my table for each record. what is the best way to reference this?
    I have a different hyperlink for each record and want the button to look at that link and open it in the browser.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Cannot use button unless you write code to run the hyperlink from the table field. Don't think that is simple code. Use a textbox instead. Set IsHyperlink property to Yes. Bind the textbox to table field. Click the textbox and hyperlink will execute.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I have it set up that way now, with a text box linked to the link field. I was wanting to clean it up and thought a button that had a specific text label (ie. button has text label that says "MSDS sheet" that on click would follow the link in that particular records hyperlink. The field is a hyperlink value.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Had trouble with this method too, maybe Im too far behind technologically, or just dont understand. I tried the Call GoHyperlink(Me.[MSDS1]) in my onclick event box along with a several other methods I could think of with no luck. Any other suggestions?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What do you mean by 'no luck' - error message, wrong results, nothing? Have you step debugged? I have never tried to run Allen Browne's or any other code for hyperlink. His code is normally reliable and I referred to this one by reputation only.

    If you want to provide project for analysis, I will look at.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Here is the doc. The link in ? is on the images tab.
    Thanks in advance. One other thing I was looking at doing and wasnt sure if you knew how to do it is to use the address field to call the map automatically in google maps with the push of the button I am trying to get to work (not having to have the aerial map field).

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You did not include Allen Browne's function code in your project. Provide project with your attempt to incorporate code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Join Date
    May 2010
    Posts
    339
    Would it be possible to change your "aerialtxt" textbox to a combo box? that way when the user selects the proper aerial map it will launch without a button.

  10. #10
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Another ? showing my lack of knowledge on this program

    I put in his code and cleaned up the notes, but what goes where the red letters are? I think I am wrong in putting the field name as this module is supposed to work for the whole database it sounds like.

    Public Function GoHyperlink(FullFilenameOrLink As Variant) As Boolean

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You don't put anything else in place of the red text. That is a variable used by the function. You will see that variable repeated in the function code. That variable will get set when you call the function from another procedure. This is a function with an argument, the argument is information the function requires in order to work.

    Function and Sub procedures are basic structures of programming. An example of intrinsic function which will round a number to specified decimal places is: Round(789.456913, 2). The number, or a variable set to a number, is the argument. Omit the argument and that function will error. Not all functions require an argument. Date() will return the current date. Now() will return the current date and time. Allen Browne's hyperlink code is a custom user function.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I followed what he suggested and the message I am getting says unable to follow link. Ive attached it (with the what should be correct code). This is just not clicking with me for some reason, sorry if it seems bothersome.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This worked for me. Do not run the PrepHyperlink function for the Google link. Do need to remove # characters from beginning and end of hyperlink string. These characters are not apparent in the table field, they appear when the hyperlink field is grabbed by VBA code. The function is not programmed to do this, VBA just does it. Might have something to do with the underline and blue highlight format of hyperlink field. So I commented out the PrepHyperlink function call and used Replace function to remove the # characters.

    'strLink = PrepHyperlink(FullFilenameOrLink, strErrMsg)
    strLink = Replace(FullFilenameOrLink, "#", "")

    Review the link at bottom of my post for a good tutorial on debugging techniques. Still might not have resolved on your own even with debugging but still good to know how for future.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Thank you sooo much, it does exactly what I was trying to get it to do. I really appreciate your time helping with this.

  15. #15
    TJRR is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    1
    Excellent...I was trying to accomplish the same feat. I would have not done it if it wasn't for the explanation described here. Thank You ..Saved me a great deal of time.

    Oh the Debugging VBA Link is

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

Similar Threads

  1. Help with embedding Hyperlinks!
    By adrian84 in forum Access
    Replies: 2
    Last Post: 06-21-2011, 01:25 PM
  2. Help with hyperlinks
    By dumbFounded in forum Access
    Replies: 4
    Last Post: 04-26-2011, 01:40 PM
  3. bound Hyperlinks
    By lazrus55 in forum Access
    Replies: 0
    Last Post: 06-03-2010, 08:10 AM
  4. Hyperlinks
    By Issy in forum Access
    Replies: 0
    Last Post: 11-13-2007, 04:46 PM
  5. Ghosting Hyperlinks
    By EisBlade in forum Access
    Replies: 0
    Last Post: 10-03-2006, 12:24 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