Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Problems using CalcPos

This is a discussion on Problems using CalcPos within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all, I'm quite new to VB and very new to using VB with MapPoint I recently created a database ...

  1. #1
    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

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I'm not sure I understeand what you ask. CalcPos takes a Location object as an argument and returns the geocoordinates of it. But I dont see the assosation with the question and the code you post. Please clarify.

  3. #3
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    As an aside, you only need to use CalcPos with MapPoint 2002 & 2004.
    2006 supports this functionality as properties of the Location object.


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  4. #4
    Pete_ADL is offline Junior Member White Belt
    Join Date
    Dec 2005
    Posts
    3
    Quote Originally Posted by Wilfried
    Hi,

    I'm not sure I understeand what you ask. CalcPos takes a Location object as an argument and returns the geocoordinates of it. But I dont see the assosation with the question and the code you post. Please clarify.
    I thought that might be the case from what I'd read, got to find out how to use that instead

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    thought that might be the case from what I'd read, got to find out how to use that instead
    Please clarify your question. I dont understeand it clearly !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Has anyone had any problems setting the value of t....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-26-2006, 08:43 AM
  2. Some concerns about calcpos sub
    By lucci56 in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-18-2006, 11:44 AM
  3. Use CalcPos on a map with EXISTING pushpins ??
    By Sonicman_ in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-20-2006, 05:05 PM
  4. Confused with calcpos :s
    By Matrices in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 09-25-2003, 10:30 AM
  5. Nothing but problems
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-22-2003, 10:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25