E
efandango
I’m trying to parse field data to google maps. So that it produces a search
criteria conforming with googlemaps multi-location convention which requires
the inclusion of ‘to:’ between each address when using moe than two addresses.
For example
From: Address_1 to: Address_2 to: Adress_3
will correctly yield a 3 point route
From: Address_1 to: Address_2 to:
will yield an errror and no route
The fields are
‘Point_1’
‘Point_2’
‘Point_3’
‘Point_4’
‘Point_5’
‘Point_6’
‘Point_7’
‘Point_8’
My code so far is:
[Form_Runs].WebRouteMap.Navigate
"http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & " to:
" & Me.Point_2 & " to: " & Me.Point_3
Which works fine, assuming that all 3 fields have address data in them.
But if the user selects only 2 fields or more than 3 are populated, then the
googlemaps data throws an error because the parsed text ends with the “to:â€
variable
What kind of code would I need for VBA to check if the last field is
populated, and If not, then just lose the last “to:†variable? This way I can
allow th user to populate up to 8 address fields, hit the parser button and
call up googlemaps for a multi location route.
criteria conforming with googlemaps multi-location convention which requires
the inclusion of ‘to:’ between each address when using moe than two addresses.
For example
From: Address_1 to: Address_2 to: Adress_3
will correctly yield a 3 point route
From: Address_1 to: Address_2 to:
will yield an errror and no route
The fields are
‘Point_1’
‘Point_2’
‘Point_3’
‘Point_4’
‘Point_5’
‘Point_6’
‘Point_7’
‘Point_8’
My code so far is:
[Form_Runs].WebRouteMap.Navigate
"http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & " to:
" & Me.Point_2 & " to: " & Me.Point_3
Which works fine, assuming that all 3 fields have address data in them.
But if the user selects only 2 fields or more than 3 are populated, then the
googlemaps data throws an error because the parsed text ends with the “to:â€
variable
What kind of code would I need for VBA to check if the last field is
populated, and If not, then just lose the last “to:†variable? This way I can
allow th user to populate up to 8 address fields, hit the parser button and
call up googlemaps for a multi location route.