At the below code i search for a value of a field of a BindingSource
and when not found i search for the 40 earlier values inside a Loop.
At the Access VB i used the same Loop with the command "DoCmd.FindReco rd"
and the rapidity was very much big.
Now at the VB this Loop be late very much (it is very slow). :(
Why this happens and how can i resolve this problem ?
Is there any other way to make this loop more fast ?
Dim found As Integer = My.Forms.skitso .SKITSABind.Fin d("skitsa", w)
If found -1 Then
My.Forms.skitso .SKITSABind.Pos ition() = found
Else
p = Val(w)
Do
found = My.Forms.skitso .SKITSABind.Fin d("skitsa", Trim(Str(p)))
If found < 0 Then p = p - 1
If found -1 Or Val(w) - p 40 Or p < 15 Then Exit Do
Loop
If found -1 Then
My.Forms.skitso .SKITSABind.Pos ition() = found
End If
Ånd If
and when not found i search for the 40 earlier values inside a Loop.
At the Access VB i used the same Loop with the command "DoCmd.FindReco rd"
and the rapidity was very much big.
Now at the VB this Loop be late very much (it is very slow). :(
Why this happens and how can i resolve this problem ?
Is there any other way to make this loop more fast ?
Dim found As Integer = My.Forms.skitso .SKITSABind.Fin d("skitsa", w)
If found -1 Then
My.Forms.skitso .SKITSABind.Pos ition() = found
Else
p = Val(w)
Do
found = My.Forms.skitso .SKITSABind.Fin d("skitsa", Trim(Str(p)))
If found < 0 Then p = p - 1
If found -1 Or Val(w) - p 40 Or p < 15 Then Exit Do
Loop
If found -1 Then
My.Forms.skitso .SKITSABind.Pos ition() = found
End If
Ånd If
Comment