Click to See Complete Forum and Search --> : REQ Help! Search never recognizes EOF


nicholas
December 16th, 1999, 08:36 AM
Unfortunately with my "find" routine, I had wanted "find next" to proceed to the BOF if EOF yet at the last record, "find next" fails. In debugging on the last record, EOF is always false; thus the "find" never proceeds to BOF. How do I get EOF = true? What have I forgotten?

Thanks!
Nick

set GridRS = GridProbViewClosed.Recordset

strQuery = Trim(TxtProbViewSearch.Text)
If len(strQuery) = 0 then Exit Sub
strQuery = "[ProbTitle]Like '*" & strQuery & "*'"

With GridRS
If lblProbViewSearch.Caption = "next" then
If .EOF = false then
.FindNext strQuery
End If
If .EOF then
.MoveFirst
.FindFirst strQuery
End If
End If
If lblProbViewSearch.Caption = "Find" then
.MoveLast
.FindFirst strQuery
lblProbViewSearch.Caption = "next"
End If

If .NoMatch then
Beep
msgStop!lblStopMessage = "My apologies but I could not find any records to match your search."
msgStop.Show 1
set msgStop = nothing
TxtProbViewSearch.SelStart = 0
TxtProbViewSearch.SelLength = len(TxtProbViewSearch.Text)
Exit Sub
End If

If Not .NoMatch then
GridProbViewClosed.MoveToBookmark GridRS.Bookmark
End If

End With
End Sub