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
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