VB Code:
If s = "" Then
Else
count = 0
Do Until (count = Me.BindingContext(objBDB, "PDDBdbReport_View").Count)
If objBDB.PDDBdbReport_View.Rows(count).Item("ProjectNumber") = s Then
pos = Me.BindingContext(objBDB, "PDDBdbReport_View").Position
End If
count = count + 1
Loop
If pos > 0 Then
Me.BindingContext(objBDB, "PDDBdbReport_View").Position = pos
Else
MsgBox("Unable to find search.", MsgBoxStyle.OKOnly, "Not found")
End If
End If
You better rephrase it in this way:
VB Code:
If s <> "" Then
count = 0
Do Until (count = Me.BindingContext(objBDB, "PDDBdbReport_View").Count)
If objBDB.PDDBdbReport_View.Rows(count).Item("ProjectNumber") = s Then
pos = Me.BindingContext(objBDB, "PDDBdbReport_View").Position
End If
count = count + 1
Loop
If pos > 0 Then
Me.BindingContext(objBDB, "PDDBdbReport_View").Position = pos
Else
MessageBox.Show("Unable to find search.", "Not found", MessageBoxButtons.OK)
End If
End If