I'm running a query that selects sewer lines form a user selected point to the sewer treatment plant.
It works perfectly unless the sewer line from selection to treatment plant has more than 100 segments.
In a nutshell QueryFilter won't select the next line after it reaches 100 selected segments.
Any ideas?
'Set the sanitary layer variable
Set pFLayer = pMap.Layer(indVal)
pFLayer.Selectable = True
Set myVal = pMap.Layer(indVal)
'Setup the query filter
Set pQFilter = New QueryFilter
pQFilter.WhereClause = "LINE_ID = '" & idVal & "' And LINE_SECTION >= " & secVal & " Order By LINE_SECTION"
'Get the selection for the layer
Set pSelection = myVal
'pSelection.Clear
'Set the selection per the QueryFilter
pView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
pSelection.SelectFeatures pQFilter, esriSelectionResultNew, False
pView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
If myFeat.Value(myFeat.Fields.FindField("LINE_SECTION")) = 0 Then Exit Sub
myCounter = 0
Do Until myCounter = 15
'Get the selection set in preparation to loop through the set
Set pSelectionSet = pSelection.SelectionSet
pSelectionSet.Search Nothing, False, pFeatureCursor
Set pFeature = pFeatureCursor.NextFeature
i = 0
'Loop through the set and collect the ids aaString is the final id, pStmains is the array with all the id's
Do While Not pFeature Is Nothing
If IsNull(pFeature.Value(pFeature.Fields.FindField("SUB"))) = False Then
Sub1 = pFeature.Value(pFeature.Fields.FindField("SUB"))
SubSec = pFeature.Value(pFeature.Fields.FindField("SUB_SEC"))
End If
aaString = pFeature.Value(pFeature.Fields.FindField("Upstreamno"))
abString = pFeature.Value(pFeature.Fields.FindField("Downstream"))
lCounter = pFeature.Value(pFeature.Fields.FindField("Length"))
pStmains(i) = aaString & " to " & abString & " ~ " & lCounter
stCount = stCount + 1
i = i + 1
Set pFeature = pFeatureCursor.NextFeature
Loop
'Setup the query filter
'Set pQFilter = New QueryFilter
'pQFilter.WhereClause = "LINE_TURN = '" & aaString & "'"
pQFilter.WhereClause = "LINE_ID = '" & Sub1 & "' And LINE_SECTION >= " & SubSec & " Order By LINE_SECTION"
'Get the selection for the layer
'Set pSelection = myVal
'pSelection.Clear
'Set the selection per the QueryFilter
pView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
pSelection.SelectFeatures pQFilter, esriSelectionResultAdd, False
pView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
myCounter = myCounter + 1
Loop