Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27071

Cant find Data in DataGrid

$
0
0
Code:

For i = 0 To ComparisonDataGrid.RowCount - 1
                If foundvalue = 0 Then
                    If tREF >= Val(ComparisonDataGrid.Rows(i).Cells(0).Value) Then
                        t1 = ComparisonDataGrid.Rows(i).Cells(0).Value
                        t2 = ComparisonDataGrid.Rows(i + 1).Cells(0).Value
                        foundvalue = 1
                    End If
                End If
            Next

What I have is tREF, a reference time value programmed in by the user (I have checked this, it DOES enter as the time the user specifies). What I am looking for in the DataGrid is t1 and t2, where t1 and t2 are the time values that tREF is in the middle of, even if t1 = tREF. For some reason, the "If tREF >=" condition keeps getting tripped on the first row, which it shouldnt be.

I am doing this with a nasty virus (bodily not computer) and am probably missing something simple, please bear with me? :)

Thanks, ryan

Viewing all articles
Browse latest Browse all 27071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>