MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




QueryCircle

This is a discussion on QueryCircle within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi I am using MP2001 and am trying to write a bit of code that will find all pushpins within ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-26-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
QueryCircle

Hi I am using MP2001 and am trying to write a bit of code that will find all pushpins within a selected area.

The problem I have is marked with a '<----------------
I cannot use my found pushpin location to run the QueryCircle...
I can only use long/lat cords. (Which seem not to tie up with my found pushpin either..)
Can someone please help?
Here is my code:

Private Sub Command0_Click()
Dim oApp As MapPoint.Application
Dim oMap As MapPoint.DataSet
Dim oRS As MapPoint.Recordset
Dim oLoc As MapPoint.Location
Dim oField As MapPoint.Field
Dim FindLoc(1 To 1) As Object
Set oApp = CreateObject("MapPoint.Application")
Set oMap = oApp.OpenMap("C:\test.ptm").DataSets("Contacts")
Set FindLoc(1) = oApp.ActiveMap.FindPushpin(Company) 'Finds pushpin from current selected contact.
FindLoc(1).BalloonState = 1
If Not FindLoc(1) Is Nothing Then
MsgBox "Found: " & FindLoc(1).Name
Set oLoc = oApp.ActiveMap.GetLocation(51.74619, 0.3337) '<---------------
'Set oLoc = oApp.ActiveMap.GetLocation(FindLoc(1)) '<----------------

Set oRS = oMap.QueryCircle(oLoc, 20)
FindLoc(1).Goto
Dim temp As String
temp = "Locations within 20 Miles of " & Company & vbCrLf & vbCrLf
oRS.MoveFirst
Do Until oRS.EOF

'oRS.Pushpin.BalloonState = 1
temp = temp & oRS.Pushpin.Name & vbCrLf
oRS.Pushpin.Highlight = True
oRS.MoveNext
Loop
MsgBox temp
oApp.ActiveMap.CopyMap
Box1.Action = acOLEPaste
Else
MsgBox "Error: Could not find " & Company
End If

Set oMap = Nothing
Set oApp = Nothing
Set oLoc = Nothing
Set oPin = Nothing
End Sub



Thanks
Pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
querycircle


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
FindNearby or QueryCircle RickS MapPoint 2006/2009 Discussion 1 12-27-2005 09:53 AM
Drawing an Oval Using The Toolbar - QueryCircle? Steve Wenck MapPoint 2006/2009 Discussion 1 08-16-2004 12:49 PM
Find Addresses in Querycircle Anonymous MapPoint 2006/2009 Discussion 0 04-02-2004 02:45 AM
QueryCircle Question Anonymous MapPoint 2006/2009 Discussion 0 09-05-2003 09:12 AM
QueryCircle Anonymous MapPoint 2006/2009 Discussion 1 04-24-2003 10:12 AM


All times are GMT -5. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Lanzarote Holiday
Enjoy a Lanzarote holiday when you check out the offers on UlookUbook and save cash!



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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59