PDA

View Full Version : Spend a Minute to Help a Newbie (Please)



GoSpinBoy
11-18-2005, 12:37 PM
I downloaded the following code from this site, which allows me to map each address individually in an Access form. I've tried to figure out how to modify it so that all addresses appear on the map at the same time but have been unsuccessful.

Can someone tell me how to tweak this code so that I can map all addresses at the same time?

Thanks so much!

Mike

-----------------------

Option Compare Database

Dim objMap As MapPoint.Map
Dim objPin As MapPoint.Pushpin

Sub Form_Load()

Set objMap = MPC.NewMap(geoMapNorthAmerica)
MPC.Toolbars.Item("Navigation").Visible = True

'This is done in the Form_Load so that the DataSets(1).Delete does not
bomb in Form_Current the first time it is run
Set objPin = objMap.AddPushpin(objMap.FindAddressResults(Me!Add ress,
Me!City, , Me!State, Me!Zip)(1))

For Each objPlaceCat In objMap.PlaceCategories
objPlaceCat.Visible = False
Next

End Sub

Private Sub Form_Current()

objMap.DataSets(1).Delete
Set objPin = objMap.AddPushpin(objMap.FindAddressResults(Me!Add ress,
Me!City, , Me!State, Me!Zip)(1))
objPin.Symbol = 57

objMap.DataSets.ZoomTo

End Sub

Private Sub Form_Unload(Cancel As Integer)
objMap.Saved = True
End Sub

GoSpinBoy
11-19-2005, 10:14 AM
Can anyone help me? Please?

Mike

Wilfried
11-20-2005, 02:16 AM
Hi,

Just call the AddPushpin method in a loop for each address you have. For example if yoir addresses are in a table then loop trough the table until you reach EOF.

GoSpinBoy
11-20-2005, 08:26 PM
Wilfried,

Thank you very much for your reply and your suggestion. I'm sorry for being such a noob, but how do I do what you suggest?

Thanks again.

Mike

calv1ns
11-20-2005, 10:25 PM
This article has all the code you will need and more.

http://www.mp2kmag.com/a48--sqlserver.dns-less.mappoint.html

Eric sells a starter book called MapPoint For Dummies at some crazy low price ($11 or something like that) - you'd best start there.

Ciao,

Eric Frost
11-21-2005, 09:05 AM
This is where you'll find the offer for the $11 book --
http://www.mp2kmag.com/whats_new.html -- 9/11/05

Eric