I have a array of datarows that sometimes has length and sometimes has 0 lenght. Do you see anything in this code segment that would make this aarray get set to 0. Whats strange is it works sometimes and sometimes it doesnt.
Private Sub Focus(ByVal field As String, ByVal criteria As String)
Dim expression As String
Dim criterias As String()
If InStr(field, "Date") Then
criterias = criteria.Split(",")
expression = field & " >= #" & criterias(0) & "#" & " AND " & field & " <= #" & criterias(1) & "#"
expression = field & " IN (" & criteria & ")"
Dim adrEdit() As DataRow = dt.Select(expression)
If UBound(adrEdit, 1) > -1 Then
Dim cdt As New DataTable
cdt = dt.Clone
For Each dr As DataRow In adrEdit
Dim cdr As DataRow
cdr = cdt.NewRow
For i As Int16 = 0 To dt.Columns.Count - 1
cdr(i) = dr(i)
dt = cdt.Copy