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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2001 You cancelled the previous operation

Status
Not open for further replies.

GenieTR

IS-IT--Management
Jan 21, 2003
28
Can you see anything wrong with this code, I am getting a "2001 you cancelled the previous operation" error message.


On Error GoTo errRequerySubForm
Dim strActorSQL As String
Dim strWHERESQL, strFullSQL As String

If (Me.SearchText) <> "" Then
strActorSQL = "([Fname] Like '" & Me.SearchText & "*" & "')" & " OR " & "([Lname] Like '" & Me.SearchText & "*" & "')"
End If
strWHERESQL = "WHERE " + strActorSQL

If strWHERESQL = "WHERE " Then
strWHERESQL = "WHERE False;"
End If
strFullSQL = "SELECT * FROM QrySearch " & strWHERESQL & ";"
Me!SearchChild.SourceObject = "Sub_frmSearch"
Me!SearchChild.Form.RecordSource = strFullSQL

exitRequerySubForm:
Exit Function

errRequerySubForm:
MsgBox Err.Number & " - " & Err.Description
Resume exitRequerySubForm

Thanks in advance
 
Change this:
If strWHERESQL = "WHERE " Then
strWHERESQL = "WHERE False;"
End If

to this:
Code:
    If strWHERESQL = "WHERE " Then
        strWHERESQL = [red]" "[/red]
    End If


HTH
Mike

[penguin] Dooobie...Doobie......Dooo
 
I did the change, but I am still getting the 2001 error message.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top