| |
Dim pMap As IMap
Dim pActiveViews As IActiveView
Dim pFeatureLayer As IFeatureLayer
Dim pFeatureSelection As IFeatureSelection
Dim pQueryFilter As IQueryFilter
Set pMxDoc = Application.Document
Set pMap = pMxDoc.FocusMap
Set pActiveViews = pMap
in the map
If Not TypeOf pMap.Layer(0) Is IFeatureLayer Then Exit Sub
Set pFeatureLayer = pMap.Layer(0)
Set pFeatureSelection = pFeatureLayer 'QI
Set pQueryFilter = New QueryFilter
pQueryFilter.WhereClause = "IPM_NUMBER > '0'"
pActiveViews.PartialRefresh esriViewGeoSelection, Nothing, Nothing
pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False
pActiveViews.PartialRefresh esriViewGeoSelection, Nothing, Nothing
Dim pCommandItem As ICommandItem
Set pCommandItem = Application.Document.CommandBars.Find(ArcId.Query_ZoomToSelected)
pCommandItem.Execute
Dim pCommandItems As ICommandItem
Set pCommandItems = Application.Document.CommandBars.Find(ArcId.Query_ClearSelection)
pCommandItems.Execute
pMxDoc.ActiveView.Refresh |