Solved

Google maps Search from MS Access passing the address

Posted on 2009-05-15
4
767 Views
Last Modified: 2013-11-28
I want to search the distance by google map using the ms access form(not open the IE), but it is not working, it just open the google map home page but not auto fill the postcode and seaching???
Private Sub cmdSearch_Click()

On Error Resume Next

    Me.WebBrowser1.Navigate "http://maps.google.co.uk/maps?hl=en&tab=wl"

Do While Me.WebBrowser1.Busy

      DoEvents

Loop

WebBrowser1.Visible = True

WebBrowser1.all.Item("d_launch").Click

WebBrowser1.Forms("d_edit_form").Item("saddr").Value = "ne3 5hn"

WebBrowser1.Forms("d_edit_form").Item("daddr").Value = "ne3 4pl"

'WebBrowser1.Document.all("daddr").Value = "ne3 4pl"

WebBrowser1.Document.Forms("d_edit_form").Item("btnG").Click
 

End Sub

Open in new window

0
Comment
Question by:Uncochen
  • 4
4 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 24396883
build up the url as suggested here http://www.vb-helper.com/howto_google_map.html then load that in your access form browser
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 24396931
eg assume postcode is in a variable called txtPostCode
using the url below, does it work?

WebBrowser1.Navigate = "http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=" & txtPostCode & "&ie=UTF8&t=m"
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24396948
Newcastle Upon Tyne eh. Stafford isnt too far is it, there used to be a great Kebab shop there, oooh that tender meat :)
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24398579
did it work?

and silly me, I was thinking of Lyme, not Tyne. Stafford is like a million miles away from toonside, lol.

Need to make a slight adjustment to the string. Its to do with the space in between the postcode. Can either add %20 or remove it altogether, google maps should still accept that

eg

WebBrowser1.Navigate = "http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=" & replace(txtPostCode," ","") & "&ie=UTF8&t=m"

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now