Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cancel an ADO Recordset.find

Status
Not open for further replies.

mgardiner

Programmer
Jun 28, 2001
22
US
I am using an ADO recordset.find to move me through a recordset to
what the user is looking for.
I want to allow them to cancel the procedure if it takes to long or
they notice that they selected the wrong field to search on or something.
once the .find has been initiated though I can't seem to stop it.
does anyone know how.

below is a sample of my code.
--------------------------------------------------------
Do While (frmSearch.mblnCancel = False)
DoEvents
Select Case FindMatch
Case Is = "Any Part Of Field"
If FindNextInt = 1 Then
With searchRS
Select Case FindDirection
Case Is = "All"
.Find FindLookIn & " like %" & findvalue & "%", 1
Case Is = "Up"
.Find FindLookIn & " like %" & findvalue & "%", 1, adSearchBackward
Case Is = "Down"
.Find FindLookIn & " like %" & findvalue & "%", 1, adSearchForward
End Select
'.Find FindLookIn & " like %" & findvalue & "%"
If .BOF Or .EOF Then
MsgBox "Matching Record not Found"
Else
searchfound(0) = searchRS.Fields("ProjectsID")
searchfound(1) = searchRS.Fields("QuoteID")
searchfound(2) = searchRS.Fields("QuoteNoRevision")
End If
End With
end if
End Select
Exit Do
Loop


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top