Open a map (1 Viewer)

Mahall906

New member
Local time
Today, 23:50
Joined
Apr 11, 2014
Messages
8
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

CID VIP
Local time
Today, 23:50
Joined
Jan 14, 2017
Messages
15,516
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, 17:50
Joined
May 11, 2011
Messages
10,651
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, 23:50
Joined
Apr 11, 2014
Messages
8
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

CID VIP
Local time
Today, 23:50
Joined
Jan 14, 2017
Messages
15,516
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