Open a map

Mahall906

New member
Local time
Today, 17:39
Joined
Apr 11, 2014
Messages
29
Learning newbie here..... still

I have a text box called 'address'. In it goes the full UK address of an individual.

I know I can create a button to open a web browser to show Google Maps, however; how can I get that OnClick button to open a map based on the address details in the 'Address' text box?

I have tried a few codes but they seem to be a tad dated.

Any help would be appreciated!
 
I have several apps that do exactly that for UK addresses. Some are commercial apps, others are free.
This is a link to a free ACCDE example app UK Postcode Address Lookup - Mendip Data Systems (source code is available at a low cost).
Or look at the code behind this free ACCDB example app Get Geolocation From Photos - Mendip Data Systems

You will need to obtain an API key from Google to use their static mapping API. That's also free unless you download over about 20000 maps per month. The documentation is at Get Started | Maps Static API | Google Developers and its very clear and detailed.
 
You just need to construct the url correctly with the address and use Shell.Application:


Code:
Sub test()

str_Address="10+Downing+St,+London+SW1A+2AB,+UK"

CreateObject("Shell.Application").Open "https://www.google.com/maps/place/" & str_Address


End Sub
 
Found this example and changed it accordingly. It was primarily one for a postcode entry but it works a treat.
13.10.2021.JPG
 
I may be wrong but I think that looks like some of my code. Anyway, glad you have a solution.
 

Users who are viewing this thread

Back
Top Bottom