Open a map (1 Viewer)

Mahall906

New member
Local time
Today, 12:51
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!
 

isladogs

MVP / VIP
Local time
Today, 12:51
Joined
Jan 14, 2017
Messages
18,186
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.
 

plog

Banishment Pending
Local time
Today, 07:51
Joined
May 11, 2011
Messages
11,611
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
 

Mahall906

New member
Local time
Today, 12:51
Joined
Apr 11, 2014
Messages
29
Found this example and changed it accordingly. It was primarily one for a postcode entry but it works a treat.
13.10.2021.JPG
 

isladogs

MVP / VIP
Local time
Today, 12:51
Joined
Jan 14, 2017
Messages
18,186
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

Top Bottom