How to parse a URL for Google Maps from SQL Address table

I have an Access 97 database with Customers. I wish to parse the address field into a URL that can be opened with Google Maps.
Has anyone done this before so I do not have to re-invent the wheel?
I see there are certain parameters to use in order for the URL to work properly.
I have the addresses stored in SQL tables.

Address1
Address2
Province/State
City
Zip/Postal Code
Country

Any suggestions please?
Thanks!
SOTAAsked:
Who is Participating?
 
PatHartmanCommented:
This is code from an old app.
Private Sub cmdGoogle_Click()
 'Opens Google Maps with the location "pinned"
 Dim strLocation As String
 Dim strTemp As String
     strLocation = Me.txtaddress & "+" & Me.cboTownCD.Column(1) & "+" & Me.cbostate & "+" & Me.cbozip
     strTemp = "http://maps.google.com/maps?q=" & strLocation
     Application.FollowHyperlink strTemp
End Sub

Open in new window

0
 
SOTAAuthor Commented:
Yea! I just implemented a similar approach! Google needs "+" between address elements, so I use a FindReplace to ensure proper parsing:
TargetURL = rs![Address1] & "+" & rs![Address2] & "+" & rs![City] & "+" & rs![Abbreviation] & "+" & rs![Country]
TargetURL = FindAndReplace(TargetURL, Chr(32), Chr(43))
TargetURL = "https://www.google.com/maps/place/" & TargetURL

Open in new window

0
 
SOTAAuthor Commented:
Oh, how do I accept your answer? Experts-Exchange keeps changing their website!
0
 
SOTAAuthor Commented:
Figured it out! Thanks for your help!!!
0
 
PatHartmanCommented:
You're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.