Help....

Here is what I came up with finally...
Code:

Function Filter()
CLS
$Flag = "True"
$Count = 0
For $count2 = 0 To UBound($c)
$iIncludeThis=0
$Comp = $C[$count2]
If $ServSort.Text = "None" OR $ServSort.Text = $Comp $iIncludeThis=1 EndIf
If $iIncludeThis = 1

ReDIM Preserve $D1[$Count]
ReDIM Preserve $T1[$Count]
ReDIM Preserve $E1[$Count]
ReDIM Preserve $C1[$count]
ReDIM Preserve $TE1[$Count]
ReDIM Preserve $BY1[$count]
$D1[$Count] = $D[$Count2]
$T1[$Count] = $T[$Count2]
$E1[$Count] = $E[$Count2]
$C1[$Count] = $C[$Count2]
$TE1[$Count] = $TE[$Count2]
$By1[$Count] = $BY[$Count2]
$count = $count + 1


EndIf
Next

$Count = 0
For $count2 = 0 To UBound($c1)
$iIncludeThis=0
$Rep = $BY1[$count2]
If $ReportSort.Text = "None" OR $ReportSort.Text = $Rep $iIncludeThis=1 EndIf
If $iIncludeThis = 1

ReDIM Preserve $D2[$Count]
ReDIM Preserve $T2[$Count]
ReDIM Preserve $E2[$Count]
ReDIM Preserve $C2[$count]
ReDIM Preserve $TE2[$Count]
ReDIM Preserve $BY2[$count]
$D2[$Count] = $D1[$Count2]
$T2[$Count] = $T1[$Count2]
$E2[$Count] = $E1[$Count2]
$C2[$Count] = $C1[$Count2]
$TE2[$Count] = $TE1[$Count2]
$By2[$Count] = $BY1[$Count2]
$count = $count + 1


EndIf

Next

$Count = 0
For $count2 = 0 To UBound($c2)
$iIncludeThis=0
$Err = $E2[$Count2]
If $ErrorSort.Text = "None" OR $ErrorSort.Text = $ERR $iIncludeThis=1 EndIf

If $iIncludeThis = 1

ReDIM Preserve $D3[$Count]
ReDIM Preserve $T3[$Count]
ReDIM Preserve $E3[$Count]
ReDIM Preserve $C3[$count]
ReDIM Preserve $TE3[$Count]
ReDIM Preserve $BY3[$count]
$D3[$Count] = $D2[$Count2]
$T3[$Count] = $T2[$Count2]
$E3[$Count] = $E2[$Count2]
$C3[$Count] = $C2[$Count2]
$TE3[$Count] = $TE2[$Count2]
$By3[$Count] = $BY2[$Count2]
$count = $count + 1


EndIf

Next

$Count = 0
Update2 ()

EndFunction



The first one works great I get my array's just like one would expect.

However when it goes to the second one it does the $count = 0 and then goes to the next $Count = 0 and then exits the function.

I can not see why it is doing this. Why will it not run the second or third instance of the filtering?
_________________________
Today is the tomorrow you worried about yesterday.