Results 1 to 12 of 12
  1. #1
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368

    Google maps from form

    Greetings,

    I have a form with underlaying table.
    On the form i have a caption called 'maps'



    In the table i have a field called 'GoogleLink' wich holds the link to the adress on google maps.
    This is a hyperlink field and when clicked it goes to the adress on google maps but i want to click
    the caption called 'maps' to do this.

    Anyone clue to an approach ?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Options:

    1. put the url in the HyperlinkAddress property

    2. use FollowHyperlink method in click event

    3. use AllenBrown GoHyperlink code http://allenbrowne.com/func-GoHyperlink.html

    4. use WebBrowser control


    Labels are not dynamic. They do not have a ControlSource property. VBA can set properties so code in some event could set the label HyperlinkAddress property to value from the field.
    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
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Hi June,

    Putting it into the hyperlinkadress is no option as my users need to be able to update the link if it changes.
    I think i have tried the FollowHyperlink method but ill give it another go.

    Ill let you know how it works out, Thanks for your reply !

    Greetings : Jeroen

  4. #4
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Suggestion:

    Do not use Hyperlink type fields at the table level. Change the field type to regular text, allowing plenty of char's (default 255 is fine). Store the real, un-obfuscated URL in the table field (and give your user a form interface to be able to change it).

    Simply code the label's CLICK event to something like:

    Application.FollowHyperlink Dlookup("fieldName","tablename")

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you want the hyperlink field, it is still possible to use FollowHyperlink or GoHyperlink. Would have to extract the address part from the hyperlink field content. I think Allen Browne's function does that for you.

    For an understanding of the hyperlink field review http://www.allenbrowne.com/casu-09.html
    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.

  6. #6
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Quote Originally Posted by June7 View Post
    If you want the hyperlink field, it is still possible to use FollowHyperlink or GoHyperlink. Would have to extract the address part from the hyperlink field content. I think Allen Browne's function does that for you.

    For an understanding of the hyperlink field review http://www.allenbrowne.com/casu-09.html
    (just to clarify) - I don't necessarily disagree with that, I just have a personal opinion that for most people, using hyperlink fields is a terrible idea. Why create something that obscures and obfuscates the real URL or path. I think it much better to store the regular URL in a text file then use any number of methods to open the file, navigate, etc.

    Of course, this didn't become clear to me until the first time I did a project where someone was very hyperlink-happy, but all of a sudden we needed to get the real data out of the fields. Then I sure wish it was plain text.

    I think hyperlink fields are a quick and lazy approach, an extra 10 minutes of coding will save you a lot of pain in the event you need to know the real paths someday - which you probably will.
    Just my opinion

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Don't disagree with that either, just nice to know options.

    Some people like the hyperlink wizard to assist with populating field, some find it frustrating. If hyperlinks are web urls, copy/paste or typing only other methods I know to populate field. The hyperlink wizard is intended to facilitate populating field with web url and it works for local folder paths as well.
    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.

  8. #8
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I dont nessecary need to have the field in my table to be a hyperlink field.
    My users are meant to be able to copy the URL in that field, Opening the URL should be done from a link om my form.

    I can easely make a control wich holds the field in the table, but i just want to open it from a link on my form called (maps)

    The code by allen Browne is long and i have bad memories from modules, but ill figure it out

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You may get some ideas from this.

  10. #10
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Got it !
    Application.FollowHyperlink Dlookup("fieldName","tablename") did it for me
    I did have to pass the where clause but with success.

    Only problem i have now is that the label doesnt show that its a link (no 'hand') and that the link opens in the background.

    Any suggestions to this ?

  11. #11
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    See http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx for some help.
    Label has hyperlink property and it can be formatted to look like a link.

  12. #12
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I worked around the no link problem by using a transparent button.

    Thanks all for thinking with me. The problem is solved

    Greetings : Jeroen

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

Similar Threads

  1. Bing Maps
    By sdel_nevo in forum Forms
    Replies: 10
    Last Post: 09-23-2014, 12:19 PM
  2. Google Maps in webbrowser control
    By bfc in forum Forms
    Replies: 10
    Last Post: 08-27-2014, 10:53 PM
  3. Replies: 4
    Last Post: 05-29-2012, 01:32 PM
  4. using google maps address into a text field
    By thanosgr in forum Programming
    Replies: 5
    Last Post: 04-26-2012, 03:39 PM
  5. Floor Maps
    By neo651 in forum Access
    Replies: 1
    Last Post: 11-09-2011, 06:31 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