HI All, I am developing a customized attribute editing form in ArcMap for our users. The users will select a polygon and follow the steps in the form to update the field. The following codes worked but it will update the field for all rows. How can I modify the codes to let it update only selected polygons in ArcMap?Appreciate the help in advance!RusselPrivate Sub cmdSave_Click()
'Get a reference to the first layer in the map
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap
Dim pFlayer As IFeatureLayer
Set pFlayer = pMap.Layer(0)
Dim pFSelection As IFeatureSelection
Set pFSelection = pFlayer
Dim pFClass As IFeatureClass
Set pFClass = pFlayer.FeatureClass
Dim pFCursor As IFeatureCursor
Set pFCursor = pFClass.Update(Nothing, True)
Dim pFeature As IFeature
Set pFeature = pFCursor.NextFeature
Do Until pFeature Is Nothing
pFeature.Value(2) = txtClassCode.Text
pFCursor.UpdateFeature pFeature
Set pFeature = pFCursor.NextFeature
Loop
End Sub