View Single Post

  #1 (permalink)  
Old 06-15-2006
Pete_ADL Pete_ADL is offline
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 3
Problems using CalcPos

Hi all, I'm quite new to VB and very new to using VB with MapPoint

I recently created a database that looks up customer shipping address and displays them in MapPoint along with the address etc in the balloon

I'd like to be a able to geocode but that are a lack of free resources in the UK, especially for the amount of locations that I'd like to do
Earlier today I read about using CalcPos to give the long and lat of a location but I'm stuck as to how to implement it and output the data

This is the code I'm using currently

Code:
Private Sub Command0_Click()
'Dim FilePathAndName As String
Dim objMap As MapPoint.Map
Dim objDataSet As MapPoint.DataSet
Dim objDataSet1 As MapPoint.DataSet
Dim objPushpin As MapPoint.Pushpin

'FilePathAndName = Application.Path &
                   ' "C:\Documents and Settings\pete.gaulton\My Documents\ServiceExchange_MapPoint.xls!Sheet1"

Set objMap = MappointControl1.ActiveMap

DoCmd.Hourglass True

' Field Service records - blue dots
Set objDataSet = objMap.DataSets.ImportData("I:\Warehousing_Distribution\_Databases\Service_Exchange\ServiceExchange_FieldService.xls")
arArray = Array(objDataSet.Fields(1), objDataSet.Fields(2), objDataSet.Fields(4), objDataSet.Fields(3), objDataSet.Fields(6), objDataSet.Fields(7), objDataSet.Fields(8), objDataSet.Fields(9), objDataSet.Fields(10), objDataSet.Fields(11))
objDataSet.SetFieldsVisibleInBalloon arArray

objDataSet.Symbol = 20

Me.txtUnmatched_FieldService = objDataSet.UnmatchedRecordCount

' Customer records - red dots
Set objDataSet1 = objMap.DataSets.ImportData("I:\Warehousing_Distribution\_Databases\Service_Exchange\ServiceExchange_excFieldService.xls")
arArray = Array(objDataSet1.Fields(1), objDataSet1.Fields(2), objDataSet1.Fields(4), objDataSet1.Fields(3), objDataSet1.Fields(6), objDataSet1.Fields(7), objDataSet1.Fields(8), objDataSet1.Fields(9), objDataSet1.Fields(10), objDataSet1.Fields(11))
objDataSet1.SetFieldsVisibleInBalloon arArray

objDataSet1.Symbol = 17

objDataSet1.ZoomTo

Me.txtUnmatched_Customer = objDataSet1.UnmatchedRecordCount

DoCmd.Hourglass False

End Sub
Any suggestions would be greatly welcomed

As a side note, all the data it can't map is added in one location on the map just outside Lancaster
Reply With Quote