Top |
Post New Question |
Read All |
MP2K Asks Microsoft
600
kurt
-
February 14, 2002
Say I import a data file containing company names, addresses, and number of employees at each address. How can i draw a polygon around a subset of these companies and find out total employees inside the polygon?
(I know i could do Export to Excel each time i draw the polygon, then add the total within Excel, but I would like to eliminate that step and see the total while still in MapPoint).
Answer:
Use the "QueryShape" method. From MapPoint 2002 help for this method:
'Find records in shape
objshape.Select
Set objRecords = objDataSet.QueryShape(objshape)
objRecords.MoveFirst
Do While Not objRecords.EOF
lngCount = lngCount + 1
objRecords.MoveNext
Loop
MsgBox "Number of records in shape: " & lngCount
So, you'd have to be able to identify the shape that you want to query, or you could do this for all Shapes having geoFreeform as a type. Then replace the accumulation of records with an accumulation of the employees field.
- Walt Cygan
Post New Answer / Follow-up