Google Maps API Autocomplete (1 Viewer)

nhorton79

Registered User.
Local time
Today, 19:29
Joined
Aug 17, 2015
Messages
147
As I have had plenty of assistance from everyone here over the years. I thought I had better post this for everyone to share.

I've been playing around with including an autocomplete address form, like you see here: Place Autocomplete Address Form | Maps JavaScript API | Google for Developers

I had initially tried doing something through html/js and then using a WebBrowser control within Access, but that was absolutely terrible. So decided I had to try and reproduce the functionality directly within Access.

Have a look. When you type in the Search box, it updates the Listbox below and makes it visible, to have the correct appearance. You can use up and down arrows to select the different suggested addresses.

It utilises a session token to ensure that the multiple requests sent to Google are billed under a single session, which is cleared once the textbox registers an empty string.

All you need to do is sign up at Google for an API key and enter this. Then you can set the country restriction to keep it localised.

There are plenty of options for addresss components and how these fit your particular area. I have used this in New Zealand but you can adjust to suit your region.

Cheers
 

Attachments

  • GoogleAutoComplete.accdb
    1.9 MB · Views: 213

sender

New member
Local time
Today, 08:29
Joined
Feb 18, 2011
Messages
1
As I have had plenty of assistance from everyone here over the years. I thought I had better post this for everyone to share.

I've been playing around with including an autocomplete address form, like you see here: Place Autocomplete Address Form | Maps JavaScript API | Google for Developers

I had initially tried doing something through html/js and then using a WebBrowser control within Access, but that was absolutely terrible. So decided I had to try and reproduce the functionality directly within Access.

Have a look. When you type in the Search box, it updates the Listbox below and makes it visible, to have the correct appearance. You can use up and down arrows to select the different suggested addresses.

It utilises a session token to ensure that the multiple requests sent to Google are billed under a single session, which is cleared once the textbox registers an empty string.

All you need to do is sign up at Google for an API key and enter this. Then you can set the country restriction to keep it localised.

There are plenty of options for addresss components and how these fit your particular area. I have used this in New Zealand but you can adjust to suit your region.

Cheers
I am getting an error on code Private Function GenerateAddress(Results As Object) As String "Variable uses an automation type not supported in visual basic". How can we resolve this
 

Jason Lee Hayes

Active member
Local time
Today, 08:29
Joined
Jul 25, 2020
Messages
182
I am getting an error on code Private Function GenerateAddress(Results As Object) As String "Variable uses an automation type not supported in visual basic". How can we resolve this
Is your error number 365 & are you running on a Mac?
 

nhorton79

Registered User.
Local time
Today, 19:29
Joined
Aug 17, 2015
Messages
147
I am getting an error on code Private Function GenerateAddress(Results As Object) As String "Variable uses an automation type not supported in visual basic". How can we resolve this
Would need to know. Is it happening on that particular line or just within that function?

What are you running his on? Windows? Mac?
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:29
Joined
Sep 21, 2011
Messages
14,528
I am getting an error on code Private Function GenerateAddress(Results As Object) As String "Variable uses an automation type not supported in visual basic". How can we resolve this
Way to go, jump into an old thread, with not enough information? :(
Do you have the last entry?

1708295071052.png
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:29
Joined
Jul 9, 2003
Messages
16,392
This is a protected thread because it is designed just to store sample databases and not to enter into discussion. This means every time you respond to this thread a moderator needs to authorize your post. The moderators are pretty quick, but you could end up with a day or two's delay if all the moderators are asleep for some reason. Could happen, especially after the Christmas party! I suggest you start another thread referencing this thread to continue discussions.
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:29
Joined
Sep 21, 2011
Messages
14,528
@Uncle Gizmo
Sorry, I just look at New Posts link, and post from there.
My apologies.
 

Users who are viewing this thread

Top Bottom