Results 1 to 6 of 6
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Double Click to get hyperlink? (2003)

    I've got an Access application where I click an image to open the Google Maps web site. To maintain consistency, I'd prefer this to require a double click instead.

    Is there a way to do this?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Double Click to get hyperlink? (2003)

    Please tell us how the application works. Does the image have an On Click event procedure, or has the Hyperlink Address property of the image been set, or ...?

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Double Click to get hyperlink? (2003)

    A couple of comments:
    1 - I assume this is related to your thread starting with <post#=471312>post 471312</post#>, in which case a continuation of that thread would have been appropriate.
    2 - Double-click is not a standard Windows (or Mac for that matter) User Interface way of doing things with web browsers or with Access forms in general. It is usually restricted to shortcuts on the desktop or starting applications by double-clicking on a file.

    In any event, to answer your question, you would need to generate some VBA code to open the hyperlink based on the double-click event of a button or another Access form control. You would also need to remove the hyperlink you used in your previous thread.
    Wendell

  4. #4
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Double Click to get hyperlink? (2003)

    1. You are correct about the other post. Since the original question had been answered, I wasn't sure if it would be better to continue it or to start a new thread. Sorry if I chose the wrong path.

    2. My Access form, which contains data about a given member of our Navy reunion group, has several small images on it. The user double-clicks one of them to either a) send the member an email, [img]/forums/images/smilies/cool.gif[/img] have a phone dialer application call him on the telephone, or c) have a label printer print a label for sending him a letter. Though the images aren't shortcuts, it's very shortcut-like to work with them -- intuitive, easy, and cool. It's also hard to do something unwanted by inadvertently clicking the mouse.

    3. I started a couple of days ago with the idea of having another shortcut-like image call up Google Maps when double clicked. I've got code that puts the member's street address on the clipboard, so I wanted to execute it before launching Google Maps. Then I'd be able to use CTRL+V to paste the street address into Google Maps, then press Enter to see a map of the guy's location. First I fooled with a command button and some VBA code to launch Google Maps, thinking it would be easy to change this to a shortcut-like image once I got everythng else working. I got some code from a VB6 book, but it never worked reliably, launching successfully only about 10% of the time.

    4. Somebody suggested just using a hyperlink with the command button. I tried it and it worked reliably, in addition to being extremely simple to implement. I wrote a VBA SUB to put the address onto the clipboard, and to my pleasure the address was there when Google Maps opened. Then I found a suitable little image and substituted it for the command button. This also works reliably when the image is single clicked.

    5. Now, to preserve uniformity of controls in the application, I'd like to require DOUBLE clicking the image to launch Google Maps. (This is a fine point, I know!) If I persist in wanting to do it this way, it looks as though I'll have to go back to where I was the day before yesterday -- trying to find some VBA code that reliably launches Google Maps. There's one more desirable thing... it would be most excellent if, in addition to launching Google Maps, the code could also paste the address from the clipboard and simulate pressing Enter.

    That's the life story of this project to date. It works great right now, but if there's a way to do it, I'd REALLY like to implement the double clicking and automatic pasting.

    ("Trifles make perfection, and perfection is no trifle." - attributed to Michaelangelo)
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Double Click to get hyperlink? (2003)

    This is along the lines indicated by Wendell:
    - Select the image (in design view).
    - Activate the Format tab of the Properties window.
    - Select the Hyperlink Address property and cut it to the clipboard (Ctrl+X)
    - Activate the Event tab of the Properties window.
    - Select [Event Procedure] in the On Dbl Click event.
    - Click the builder button ...
    - Type

    Application.FollowHyperlink "

    - Paste the hyperlink address (Ctrl+V)
    - Type the closing quote ".

    Using SendKeys doesn't seem to work with the Google Maps site.

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Double Click to get hyperlink? (2003)

    In addition to the suggestion by Hans, you might find <post#=270029>post 270029</post#> and the thread beginning with <post#=202500>post 202500</post#> which talk about using the Shell command to start Internet Explorer. One issue you might want to consider is browsers other than IE - will your approach work with Firefox for example.
    Wendell

Posting Permissions

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