Map online using Access database (1 Viewer)

FrankJ

New member
Local time
Today, 08:34
Joined
Jun 3, 2005
Messages
4
I want to locate an address online from my access database program upon clicking a button. What will be the best way to do this. Does access database have the tool to link address from your program.



Any help p
 

yammoo

Registered User.
Local time
Today, 10:34
Joined
Feb 21, 2007
Messages
29
possible solution

yes, I have one on my database, but I must warn you it is not extensive or anything of the sort. I searched extensively on the net for several days until one day it just appeared in a search without any warning.

anyways, it takes your address city state and whatever and passes it into a google map, but a plain simple google map search. doesnt place in satelite imagery or fancy smancy stuff. my client absolutely flipped for it. and what I like about it is you don't need a tool plug in or some of the other fancy stuff that google requires for "advanced map searches".

ok, i'll stop jibber jabbering. here is the link (vba coding required though).......
http://metrix.fcny.org/wiki/pages/diffpages.action?pageId=5054&originalId=11341#change0

hopefully you'll be able to take advantage of it, if its not what you wanted, I hope someone else out there has a more appropriate solution for you.

please post back with results / comments / questions.

yammoo
 

Moniker

VBA Pro
Local time
Today, 10:34
Joined
Dec 21, 2006
Messages
1,567
It's simpler than you think. You make a textbox where the user enters an address. In the textbox's BeofreUpdate event, you place the contents into the HyperlinkAddress property of a command button. You click the button and voila! A map.

Here's the entire code to do it (assuming you replicate my control names):

Code:
Private Sub cmdShowMap_Click()

    If cmdShowMap.HyperlinkAddress = "" Then
        MsgBox "Please enter an address first.", vbOKOnly + vbInformation, "No Address Entered"
        Exit Sub
    End If
    
End Sub

Private Sub txtAddress_BeforeUpdate(Cancel As Integer)

    cmdShowMap.HyperlinkAddress = Switch(Nz(txtAddress, "") <> "", "http://www.google.com/maps?q=" & txtAddress, True, "")
        
End Sub

See the attached. I even included a little dummy-proofing. :p (You can't leave the address textbox blank.) Without the dummy-proofing, you will get an error if the address textbox is blank. That could be made into a validation rule (Is Not Null), thereby killing the entire "Sub cmdShowMap" code and lower it to one line of code.

HTH
 

Attachments

  • mapper.zip
    10.8 KB · Views: 726
Last edited:

Dreamweaver

Well-known member
Local time
Today, 16:34
Joined
Nov 28, 2005
Messages
2,466
Was looking for something like this age's ago thanks just perfect typed my Postcode in and came up with the exact location well detailed.

Thanks Will Add This to my project Management\Time Billing System.

Best wishes

Mick
 

Users who are viewing this thread

Top Bottom