473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help with Google Maps

I am a true beginner in Access and coding.

I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.

I don't even know where to begin. Can someone please help?
Jun 27 '08 #1
6 3389
pa******@gmail.com wrote:
I am a true beginner in Access and coding.

I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.

I don't even know where to begin. Can someone please help?
These 2 routines might help. I have a form with 4 fields; City, State,
Address, and ZipCode. MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.

On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.

I pass strType to MakeUrl. If blank, it creates the URL for displaying
a map of the location specified. If strType = "Driving" then I create
the URL for driving instructions. It opens InternetExplorer to the URL.

If the fields on your form match my field names it's ready to run as-is.
If not, change the field names in the code below to match your textbox
field names.

Then create a command button. In the OnClick event enter
MakeUrl "" 'no driving instructions
or
MakeUrl "Driving" 'driving instructions.

Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
Dim strURL As String
Dim objBrowser As Object

If IsNull(Me.City) Or IsNull(Me.State) Then
MsgBox "You need to supply at least the city and state."
Me.City.SetFocus
Else
strURL = CreateUrl(Me.Address, Me.City, Me.State, Me.ZipCode)

If strType = "Driving" Then
strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
End If
strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"

Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application")
With obj
.Navigate2 strURL
.Visible = True
End With
Set obj = Nothing
End If
Exit_MakeURL:
Exit Sub

Err_MakeURL:
MsgBox Err.Description
Resume Exit_MakeURL

End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
'generate the URL to pass to Google in browser.
Dim strURL As String
Dim strOrig As String
Dim intPos As Integer

If Not IsNull(strAddress) Then
strOrig = strAddress
Do While True
If strOrig <"" Then
intPos = InStr(strOrig, " ")
If intPos 0 Then
strURL = strURL & Left(strOrig, intPos - 1) & "+"
strOrig = LTrim(Mid(strOrig, intPos + 1))
Else
strURL = strURL & strOrig & "+"
Exit Do
End If
Else
Exit Do
End If
Loop
End If
strURL = strURL & strCity & "+" & strState & "+"
If Not IsNull(strZip) Then strURL = strURL & strZip & "+"

CreateUrl = Left(strURL, Len(strURL) - 1)

End Function

RaceCard
http://www.youtube.com/watch?v=1FQtN2NbGv8
Jun 27 '08 #2
On Apr 22, 10:19*am, Salad <o...@vinegar.comwrote:
pagin...@gmail.com wrote:
I am a true beginner in Access and coding.
I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.
I don't even know where to begin. Can someone please help?

These 2 routines might help. *I have a form with 4 fields; City, State,
Address, and ZipCode. *MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.

On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.

I pass strType to MakeUrl. *If blank, it creates the URL for displaying
a map of the location specified. *If strType = "Driving" then I create
the URL for driving instructions. *It opens InternetExplorer to the URL.

If the fields on your form match my field names it's ready to run as-is.
* If not, change the field names in the code below to match your textbox
field names.

Then create a command button. *In the OnClick event enter
* * * * MakeUrl "" * 'no driving instructions
or
* * * * MakeUrl "Driving" *'driving instructions.

Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
* * *Dim strURL As String
* * *Dim objBrowser As Object

* * *If IsNull(Me.City) Or IsNull(Me.State) Then
* * * * *MsgBox "You need to supply at least the city and state."
* * * * *Me.City.SetFocus
* * *Else
* * * * *strURL = CreateUrl(Me.Address, Me.City, Me.State, Me.ZipCode)

* * * * *If strType = "Driving" Then
* * * * * * *strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
* * * * *End If
* * * * *strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"

* * * * *Dim obj As Object
* * * * *Set obj = CreateObject("InternetExplorer.Application")
* * * * *With obj
* * * * * * *.Navigate2 strURL
* * * * * * *.Visible = True
* * * * *End With
* * * * *Set obj = Nothing
* * *End If
Exit_MakeURL:
* * *Exit Sub

Err_MakeURL:
* * *MsgBox Err.Description
* * *Resume Exit_MakeURL

End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
* * *'generate the URL to pass to Google in browser.
* * *Dim strURL As String
* * *Dim strOrig As String
* * *Dim intPos As Integer

* * *If Not IsNull(strAddress) Then
* * * * *strOrig = strAddress
* * * * *Do While True
* * * * * * *If strOrig <"" Then
* * * * * * * * *intPos = InStr(strOrig, " ")
* * * * * * * * *If intPos 0 Then
* * * * * * * * * * *strURL = strURL & Left(strOrig, intPos - 1) & "+"
* * * * * * * * * * *strOrig = LTrim(Mid(strOrig, intPos + 1))
* * * * * * * * *Else
* * * * * * * * * * *strURL = strURL & strOrig & "+"
* * * * * * * * * * *Exit Do
* * * * * * * * *End If
* * * * * * *Else
* * * * * * * * *Exit Do
* * * * * * *End If
* * * * *Loop
* * *End If
* * *strURL = strURL & strCity & "+" & strState & "+"
* * *If Not IsNull(strZip) Then strURL = strURL & strZip & "+"

* * *CreateUrl = Left(strURL, Len(strURL) - 1)

End Function

RaceCardhttp://www.youtube.com/watch?v=1FQtN2NbGv8
(I'm not sure if the message I just sent you actually sent, so I'll
post again)
Could you explain this step in more detail please?

"I pass strType to MakeUrl. If blank, it creates the URL for
displaying
a map of the location specified. If strType = "Driving" then I
create
the URL for driving instructions. It opens InternetExplorer to the
URL. "

Sorry, I truly am a begginer.
Jun 27 '08 #3
pagina wrote:
On Apr 22, 10:19 am, Salad <o...@vinegar.comwrote:
>>pagin...@gmail.com wrote:
>>>I am a true beginner in Access and coding.
>>>I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.
>>>I don't even know where to begin. Can someone please help?

These 2 routines might help. I have a form with 4 fields; City, State,
Address, and ZipCode. MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.

On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.

I pass strType to MakeUrl. If blank, it creates the URL for displaying
a map of the location specified. If strType = "Driving" then I create
the URL for driving instructions. It opens InternetExplorer to the URL.

If the fields on your form match my field names it's ready to run as-is.
If not, change the field names in the code below to match your textbox
field names.

Then create a command button. In the OnClick event enter
MakeUrl "" 'no driving instructions
or
MakeUrl "Driving" 'driving instructions.

Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
Dim strURL As String
Dim objBrowser As Object

If IsNull(Me.City) Or IsNull(Me.State) Then
MsgBox "You need to supply at least the city and state."
Me.City.SetFocus
Else
strURL = CreateUrl(Me.Address, Me.City, Me.State, Me.ZipCode)

If strType = "Driving" Then
strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
End If
strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"

Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application")
With obj
.Navigate2 strURL
.Visible = True
End With
Set obj = Nothing
End If
Exit_MakeURL:
Exit Sub

Err_MakeURL:
MsgBox Err.Description
Resume Exit_MakeURL

End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
'generate the URL to pass to Google in browser.
Dim strURL As String
Dim strOrig As String
Dim intPos As Integer

If Not IsNull(strAddress) Then
strOrig = strAddress
Do While True
If strOrig <"" Then
intPos = InStr(strOrig, " ")
If intPos 0 Then
strURL = strURL & Left(strOrig, intPos - 1) & "+"
strOrig = LTrim(Mid(strOrig, intPos + 1))
Else
strURL = strURL & strOrig & "+"
Exit Do
End If
Else
Exit Do
End If
Loop
End If
strURL = strURL & strCity & "+" & strState & "+"
If Not IsNull(strZip) Then strURL = strURL & strZip & "+"

CreateUrl = Left(strURL, Len(strURL) - 1)

End Function

RaceCardhttp://www.youtube.com/watch?v=1FQtN2NbGv8


(I'm not sure if the message I just sent you actually sent, so I'll
post again)
Could you explain this step in more detail please?

"I pass strType to MakeUrl. If blank, it creates the URL for
displaying
a map of the location specified. If strType = "Driving" then I
create
the URL for driving instructions. It opens InternetExplorer to the
URL. "

Sorry, I truly am a begginer.
Let's say you have a form with 4 textbox fields name; address, city,
state, zip. There's also 1 command button to call GoogleMaps...name it
CommandMap. Take my code and post it in the form's code module. If
your field names are NOT address, city, state, zip then change those
names in my code to the names of your textbox controls.

In the OnClick event of the code module you would enter
MakeUrl " "

You can check this out easily enough. Create a table with the fields
address, city, state, zip. Save the table. Open it and add a record.

Now using the form wizard (Forms/New/Wizard) create a form for that
table. Open it in design mode and add the command button CommandMap to
your form and in the OnClick of event CommandMap enter
MakeUrl " "

Save the form. Then open it and see if it works.

Now if I had 4 more textboxes on the form; toaddress, tocity, tostate,
tozip then I have a starting address and an ending address. I could get
driving instructions by entering in the OnClick of event of CommandMap
MakeUrl "Driving"
Jun 27 '08 #4
On Apr 22, 5:23*pm, Salad <o...@vinegar.comwrote:
pagina wrote:
On Apr 22, 10:19 am, Salad <o...@vinegar.comwrote:
>pagin...@gmail.com wrote:
>>I am a true beginner in Access and coding.
>>I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.
>>I don't even know where to begin. Can someone please help?
>These 2 routines might help. *I have a form with 4 fields; City, State,
Address, and ZipCode. *MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.
>On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.
>I pass strType to MakeUrl. *If blank, it creates the URL for displaying
a map of the location specified. *If strType = "Driving" then I create
the URL for driving instructions. *It opens InternetExplorer to the URL.
>If the fields on your form match my field names it's ready to run as-is.
*If not, change the field names in the code below to match your textbox
field names.
>Then create a command button. *In the OnClick event enter
* * * *MakeUrl "" * 'no driving instructions
or
* * * *MakeUrl "Driving" *'driving instructions.
>Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
* * Dim strURL As String
* * Dim objBrowser As Object
* * If IsNull(Me.City) Or IsNull(Me.State) Then
* * * * MsgBox "You need to supply at least the city and state."
* * * * Me.City.SetFocus
* * Else
* * * * strURL = CreateUrl(Me.Address, Me.City, Me.State, Me.ZipCode)
* * * * If strType = "Driving" Then
* * * * * * strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
* * * * End If
* * * * strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"
* * * * Dim obj As Object
* * * * Set obj = CreateObject("InternetExplorer.Application")
* * * * With obj
* * * * * * .Navigate2 strURL
* * * * * * .Visible = True
* * * * End With
* * * * Set obj = Nothing
* * End If
Exit_MakeURL:
* * Exit Sub
>Err_MakeURL:
* * MsgBox Err.Description
* * Resume Exit_MakeURL
>End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
* * 'generate the URL to pass to Google in browser.
* * Dim strURL As String
* * Dim strOrig As String
* * Dim intPos As Integer
* * If Not IsNull(strAddress) Then
* * * * strOrig = strAddress
* * * * Do While True
* * * * * * If strOrig <"" Then
* * * * * * * * intPos = InStr(strOrig, " ")
* * * * * * * * If intPos 0 Then
* * * * * * * * * * strURL = strURL & Left(strOrig, intPos - 1) & "+"
* * * * * * * * * * strOrig = LTrim(Mid(strOrig, intPos + 1))
* * * * * * * * Else
* * * * * * * * * * strURL = strURL & strOrig & "+"
* * * * * * * * * * Exit Do
* * * * * * * * End If
* * * * * * Else
* * * * * * * * Exit Do
* * * * * * End If
* * * * Loop
* * End If
* * strURL = strURL & strCity & "+" & strState & "+"
* * If Not IsNull(strZip) Then strURL = strURL & strZip & "+"
* * CreateUrl = Left(strURL, Len(strURL) - 1)
>End Function
>RaceCardhttp://www.youtube.com/watch?v=1FQtN2NbGv8
(I'm not sure if the message I just sent you actually sent, so I'll
post again)
Could you explain this step in more detail please?
"I pass strType to MakeUrl. *If blank, it creates the URL for
displaying
a map of the location specified. *If strType = "Driving" then I
create
the URL for driving instructions. *It opens InternetExplorer to the
URL. "
Sorry, I truly am a begginer.

Let's say you have a form with 4 textbox fields name; address, city,
state, zip. *There's also 1 command button to call GoogleMaps...name it
CommandMap. *Take my code and post it in the form's code module. *If
your field names are NOT address, city, state, zip then change those
names in my code to the names of your textbox controls.

In the OnClick event of the code module you would enter
* * * * MakeUrl " "

You can check this out easily enough. *Create a table with the fields
address, city, state, zip. *Save the table. *Open it and add a record.

Now using the form wizard (Forms/New/Wizard) create a form for that
table. *Open it in design mode and add the command button CommandMap to
your form and in the OnClick of event CommandMap enter
* * * * MakeUrl " "

Save the form. *Then open it and see if it works.

Now if I had 4 more textboxes on the form; toaddress, tocity, tostate,
tozip then I have a starting address and an ending address. *I could get
driving instructions by entering in the OnClick of event of CommandMap
* * * * MakeUrl "Driving"- Hide quoted text -

- Show quoted text -
Okay, I did everything you said exactly and and error message comes up
that says "MS Access can't find the macro 'MakeURL "" .'
Jun 27 '08 #5
pagina wrote:
On Apr 22, 5:23 pm, Salad <o...@vinegar.comwrote:
>>pagina wrote:
>>>On Apr 22, 10:19 am, Salad <o...@vinegar.comwrote:
>>>>pagin...@gmail.com wrote:
>>>>>I am a true beginner in Access and coding.
>>>>>I am creating a database with facility information and I want to use
>the address of a specific facility to display a map on my form or at
>least open a new window with the address already plugged into Google
>maps.
>>>>>I don't even know where to begin. Can someone please help?
>>>>These 2 routines might help. I have a form with 4 fields; City, State,
Address, and ZipCode. MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.
>>>>On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.
>>>>I pass strType to MakeUrl. If blank, it creates the URL for displaying
a map of the location specified. If strType = "Driving" then I create
the URL for driving instructions. It opens InternetExplorer to the URL.
>>>>If the fields on your form match my field names it's ready to run as-is.
If not, change the field names in the code below to match your textbox
field names.
>>>>Then create a command button. In the OnClick event enter
MakeUrl "" 'no driving instructions
or
MakeUrl "Driving" 'driving instructions.
>>>>Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
Dim strURL As String
Dim objBrowser As Object
>>> If IsNull(Me.City) Or IsNull(Me.State) Then
MsgBox "You need to supply at least the city and state."
Me.City.SetFocus
Else
strURL = CreateUrl(Me.Address, Me.City, Me.State, Me.ZipCode)
>>> If strType = "Driving" Then
strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
End If
strURL = "http://maps.google.com/maps?q=" & strURL &
"&iwloc=A&hl=en"
>>> Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application")
With obj
.Navigate2 strURL
.Visible = True
End With
Set obj = Nothing
End If
Exit_MakeURL:
Exit Sub
>>>>Err_MakeURL:
MsgBox Err.Description
Resume Exit_MakeURL
>>>>End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
'generate the URL to pass to Google in browser.
Dim strURL As String
Dim strOrig As String
Dim intPos As Integer
>>> If Not IsNull(strAddress) Then
strOrig = strAddress
Do While True
If strOrig <"" Then
intPos = InStr(strOrig, " ")
If intPos 0 Then
strURL = strURL & Left(strOrig, intPos - 1) & "+"
strOrig = LTrim(Mid(strOrig, intPos + 1))
Else
strURL = strURL & strOrig & "+"
Exit Do
End If
Else
Exit Do
End If
Loop
End If
strURL = strURL & strCity & "+" & strState & "+"
If Not IsNull(strZip) Then strURL = strURL & strZip & "+"
>>> CreateUrl = Left(strURL, Len(strURL) - 1)
>>>>End Function
>>>>RaceCardhttp://www.youtube.com/watch?v=1FQtN2NbGv8
>>>(I'm not sure if the message I just sent you actually sent, so I'll
post again)
Could you explain this step in more detail please?
>>>"I pass strType to MakeUrl. If blank, it creates the URL for
displaying
a map of the location specified. If strType = "Driving" then I
create
the URL for driving instructions. It opens InternetExplorer to the
URL. "
>>>Sorry, I truly am a begginer.

Let's say you have a form with 4 textbox fields name; address, city,
state, zip. There's also 1 command button to call GoogleMaps...name it
CommandMap. Take my code and post it in the form's code module. If
your field names are NOT address, city, state, zip then change those
names in my code to the names of your textbox controls.

In the OnClick event of the code module you would enter
MakeUrl " "

You can check this out easily enough. Create a table with the fields
address, city, state, zip. Save the table. Open it and add a record.

Now using the form wizard (Forms/New/Wizard) create a form for that
table. Open it in design mode and add the command button CommandMap to
your form and in the OnClick of event CommandMap enter
MakeUrl " "

Save the form. Then open it and see if it works.

Now if I had 4 more textboxes on the form; toaddress, tocity, tostate,
tozip then I have a starting address and an ending address. I could get
driving instructions by entering in the OnClick of event of CommandMap
MakeUrl "Driving"- Hide quoted text -

- Show quoted text -


Okay, I did everything you said exactly and and error message comes up
that says "MS Access can't find the macro 'MakeURL "" .'
I wrote "Take my code and post it in the form's code module.". Did you
copy/paste my code for MakeUrl and CreateUrl into the form's code module?

If you open the property sheet for the command button CommandMap, select
Events, click on the OnClick row. There'll be a button with ... as
its caption on the far right of the row. Press on it...one of the
options is Code. Select Code and put the
MakeUrl " "
line between the Sub and End Sub lines.

We're getting close!

Why Aye Man
http://www.youtube.com/watch?v=0NHmpOER-sA

Jun 27 '08 #6
On Apr 23, 10:56*am, Salad <o...@vinegar.comwrote:
pagina wrote:
On Apr 22, 5:23 pm, Salad <o...@vinegar.comwrote:
>pagina wrote:
>>On Apr 22, 10:19 am, Salad <o...@vinegar.comwrote:
>>>pagin...@gmail.com wrote:
>>>>I am a true beginner in Access and coding.
>>>>I am creating a database with facility information and I want to use
the address of a specific facility to display a map on my form or at
least open a new window with the address already plugged into Google
maps.
>>>>I don't even know where to begin. Can someone please help?
>>>These 2 routines might help. *I have a form with 4 fields; City, State,
Address, and ZipCode. *MakeUrl calls routine CreateUrl that makes the
URL for googlemaps.
>>>On my form I also suppled 4 more fields; ToCity, ToState, ToAddress, and
ToZipCode if I want driving instructions.
>>>I pass strType to MakeUrl. *If blank, it creates the URL for displaying
a map of the location specified. *If strType = "Driving" then I create
the URL for driving instructions. *It opens InternetExplorer to the URL.
>>>If the fields on your form match my field names it's ready to run as-is.
If not, change the field names in the code below to match your textbox
field names.
>>>Then create a command button. *In the OnClick event enter
* * * MakeUrl "" * 'no driving instructions
or
* * * MakeUrl "Driving" *'driving instructions.
>>>Private Sub MakeURL(strType As String)
On Error GoTo Err_MakeURL
* *Dim strURL As String
* *Dim objBrowser As Object
>>* *If IsNull(Me.City) Or IsNull(Me.State) Then
* * * *MsgBox "You need to supply at least the city and state.."
* * * *Me.City.SetFocus
* *Else
* * * *strURL = CreateUrl(Me.Address, Me.City, Me.State, Me..ZipCode)
>>* * * *If strType = "Driving" Then
* * * * * *strURL = strURL & "+" & "to" & "+" &
CreateUrl(Me.ToAddress, Me.ToCity, Me.ToState, Me.ToZipCode)
* * * *End If
* * * *strURL = "http://maps.google.com/maps?q=" & strURL&
"&iwloc=A&hl=en"
>>* * * *Dim obj As Object
* * * *Set obj = CreateObject("InternetExplorer.Application")
* * * *With obj
* * * * * *.Navigate2 strURL
* * * * * *.Visible = True
* * * *End With
* * * *Set obj = Nothing
* *End If
Exit_MakeURL:
* *Exit Sub
>>>Err_MakeURL:
* *MsgBox Err.Description
* *Resume Exit_MakeURL
>>>End Sub
Private Function CreateUrl(strAddress As Variant, strCity As String,
strState As String, strZip As Variant) As String
* *'generate the URL to pass to Google in browser.
* *Dim strURL As String
* *Dim strOrig As String
* *Dim intPos As Integer
>>* *If Not IsNull(strAddress) Then
* * * *strOrig = strAddress
* * * *Do While True
* * * * * *If strOrig <"" Then
* * * * * * * *intPos = InStr(strOrig, " ")
* * * * * * * *If intPos 0 Then
* * * * * * * * * *strURL = strURL & Left(strOrig, intPos - 1) & "+"
* * * * * * * * * *strOrig = LTrim(Mid(strOrig,intPos + 1))
* * * * * * * *Else
* * * * * * * * * *strURL = strURL & strOrig & "+"
* * * * * * * * * *Exit Do
* * * * * * * *End If
* * * * * *Else
* * * * * * * *Exit Do
* * * * * *End If
* * * *Loop
* *End If
* *strURL = strURL & strCity & "+" & strState & "+"
* *If Not IsNull(strZip) Then strURL = strURL & strZip & "+"
>>* *CreateUrl = Left(strURL, Len(strURL) - 1)
>>>End Function
>>>RaceCardhttp://www.youtube.com/watch?v=1FQtN2NbGv8
>>(I'm not sure if the message I just sent you actually sent, so I'll
post again)
Could you explain this step in more detail please?
>>"I pass strType to MakeUrl. *If blank, it creates the URL for
displaying
a map of the location specified. *If strType = "Driving" then I
create
the URL for driving instructions. *It opens InternetExplorer to the
URL. "
>>Sorry, I truly am a begginer.
>Let's say you have a form with 4 textbox fields name; address, city,
state, zip. *There's also 1 command button to call GoogleMaps...name it
CommandMap. *Take my code and post it in the form's code module. *If
your field names are NOT address, city, state, zip then change those
names in my code to the names of your textbox controls.
>In the OnClick event of the code module you would enter
* * * *MakeUrl " "
>You can check this out easily enough. *Create a table with the fields
address, city, state, zip. *Save the table. *Open it and add a record.
>Now using the form wizard (Forms/New/Wizard) create a form for that
table. *Open it in design mode and add the command button CommandMap to
your form and in the OnClick of event CommandMap enter
* * * *MakeUrl " "
>Save the form. *Then open it and see if it works.
>Now if I had 4 more textboxes on the form; toaddress, tocity, tostate,
tozip then I have a starting address and an ending address. *I could get
driving instructions by entering in the OnClick of event of CommandMap
* * * *MakeUrl "Driving"- Hide quoted text -
>- Show quoted text -
Okay, I did everything you said exactly and and error message comes up
that says "MS Access can't find the macro 'MakeURL "" .'

I wrote "Take my code and post it in the form's code module.". *Did you
copy/paste my code for MakeUrl and CreateUrl into the form's code module?

If you open the property sheet for the command button CommandMap, select
* Events, click on the OnClick row. *There'll be a button with ... as
its caption on the far right of the row. *Press on it...one of the
options is Code. *Select Code and put the
* * * * MakeUrl " "
line between the Sub and End Sub lines.

We're getting close!

Why Aye Manhttp://www.youtube.com/watch?v=0NHmpOER-sA
Okay, now I get a Compile Error: Expected End Sub
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sean | last post by:
Have you ever wanted to add the great features inherent in Google Maps? Here is how you do it. ============== == STEP ONE == ============== Create a new MS Access form called frmGoogleMap....
0
by: windandwaves | last post by:
Hi Folk Some of you may find this function useful. It makes it easier to create maps using Google Maps. I link it to a database of points. The main use of the function is that it creates all...
6
by: Sam Carleton | last post by:
Ok, over the years I have read about doing web programing and I have done some real basic stuff. Now I am digging into some real ASP.Net 2.0 and am totally lost some things. I have a master...
1
by: xahlee | last post by:
Elisp Tutorial: Make Google Earth Xah Lee, 2006-12 This page shows a example of writing a emacs lisp function that creates a Google Earth file, and creates a link to the file, as well a link...
5
by: xml .NET group | last post by:
Is there any book on using ASP.NET for Google Maps. For example, following books: http://www.amazon.com/Beginning-Google-Maps-Applications-Ajax/dp/1590597079/ ...
3
by: Phil Stanton | last post by:
I have a button on a form which when pressed displays a google map of the address. Code is Private Sub Googlemap_Click() MakeURL ("") End Sub
2
by: H.Schmidt | last post by:
Hi! im would like to get address informations like city, state or zip for a given GPoint. Is it possible (i found nothing in Google maps Api)? Thanks in advance
1
by: Anthony2oo5 | last post by:
Iv been searching for a way to get the distance in miles from one location to another, and thought the best way is using google maps. Back in the day I did this by using a curl command and regular...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.