Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| QueryCircle 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 |
![]() |
| Tags |
| querycircle |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Lanzarote Holiday
Enjoy a Lanzarote holiday when you check out the offers on UlookUbook and save cash!