Retaining selection set

354
2
07-14-2011 02:32 PM
JoeMcCollum
New Contributor
It's the end of a long day -- here's what I've got

Private Sub CommandButton4_Click()
  Dim pMxDoc As IMxDocument
  Set pMxDoc = ThisDocument
  Dim pMap As IMap
  Set pMap = pMxDoc.FocusMap
  Dim pFL As IFeatureLayer
  Set pFL = pMap.Layer(0)
 
  Dim pQFilter As IQueryFilter
  Set pQFilter = New QueryFilter
  pQFilter.WhereClause = "PLU > 20"

  Dim pFCursor As IFeatureCursor
  Set pFCursor = pFL.Search(pQFilter, True)

  MsgBox ("done")
 
End Sub


Now for all these records (it's a point layer), I'd like the user to visit each point in turn -- I don't think I need help with that part -- then allow the user to change the PLU or agree with it.  (I'm thinking that the user will click a different button to either change it or go to the next record).  This first button simply selects records.  Maybe there's other kind of selection to get the points highlighted and such. 

Do I need to declare some sort of ISelectionSet as a global variable or is there an easier way?
0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
Having the user visit each selected item could be slow and tedious.  A better solution IMO would be to simply display the query results in a data grid so that the user can change the ones they want and simply ignore the rest.  I would also include a way for them to select multiple rows in the grid and update them to the same value all at once instead of having to edit each one individually.
0 Kudos
JoeMcCollum
New Contributor
I adapted code from this thread to get me started:  http://forums.esri.com/Thread.asp?c=93&f=992&t=86538
0 Kudos