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 3 of 3

Sanity Check Please......Pushpin help

This is a discussion on Sanity Check Please......Pushpin help within the MapPoint Desktop Discussion forums, part of the Map Forums category; If a user manually adds two or more pushpins to a map control, there has got to be a way ...

  1. #1
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56

    Sanity Check Please......Pushpin help

    If a user manually adds two or more pushpins to a map control, there has got to be a way to cycle through them all to get the names of the pushpins, doesn't there?

    I tried this example:

    Dim objDataSet As MapPoint.DataSet
    Dim objRecordset As MapPoint.Recordset
    Dim objField As MapPoint.Field
    objDataSet = AxMappointControl1.OpenMap("C:\Program Files\Microsoft MapPoint\Samples\Clients.ptm").DataSets("Clients")

    'Retrieve all records
    objRecordset = objDataSet.QueryAllRecords

    'Get the values
    Dim vals As String
    objRecordset.MoveFirst()
    Do Until objRecordset.EOF
    For Each objField In objRecordset.Fields
    vals = vals & CStr(objField.Value) & vbTab
    Next objField
    vals = vals & vbCrLf
    objRecordset.MoveNext()
    Loop
    MsgBox(vals)


    which works just great for the sample, but when I try the same thing after adding pushpins, my objRecordSet shows the right number of pushpins, but the number or Fields is 0, so this:

    For Each objField In objRecordset.Fields

    Just falls right through.

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    Don't worry about the fields. Consider this example.

    Code:
    Set objmap = MappointControl1.ActiveMap
    Dim objRecordSet As MapPointctl.Recordset
    Dim objpushpin As MapPointctl.Pushpin
    
    For Each objDataSet In objmap.DataSets
    If objDataSet.Name = "My Pushpins" Then
    Set objRecordSet = objDataSet.QueryAllRecords
    objRecordSet.MoveFirst
    
    Do Until objRecordSet.EOF
    MsgBox objRecordSet.Pushpin.Name
    objRecordSet.MoveNext
    Loop
    
    End If
    Exit For
    Next

  3. #3
    EdB
    EdB is offline Member Green Belt
    Join Date
    Aug 2002
    Posts
    56
    Meant to get back to you on this.

    Worked perfect....thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Check out if GPS pos is on a Route
    By kristijan in forum MapPoint Desktop Discussion
    Replies: 11
    Last Post: 04-19-2006, 11:46 AM
  2. Is there way to check if you're on a road
    By Omair in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-05-2005, 07:56 AM
  3. Check error with VBA before adding pushpin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-24-2004, 10:36 AM
  4. GPS position check
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 14
    Last Post: 01-19-2004, 02:00 AM
  5. Check if a waypoint and a pushpin exist
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-19-2003, 10:27 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