L
Lars Pedersen
Hi there.
I am getting run-time error 2001 "You cancled the previus operation", when
my code reach
the frmFilterOn=true . I can not find out what operation it is talking
about and why, can anyone help me.
The code is on a popup search form, ID is autonumber that uniquely
identifies the record
Code:
Private Sub cmdUseAsFilter_Click()
Dim Criteria As String
Dim i As Variant
Dim frm As Form
Set frm = Forms(Me.OpenArgs)
' Build criteria string from selected items in list box.
Criteria = ""
For Each i In Me![lstShipInfo].ItemsSelected
If Criteria <> "" Then
Criteria = Criteria & " OR "
End If
Criteria = Criteria & " ID = '" & Me![lstShipInfo].ItemData(i) & "'"
Next i
' Filter the form using selected items in the list box.
frm.Filter = Criteria
frm.FilterOn = True
DoCmd.Close acForm, Me.Name
End Sub
I am getting run-time error 2001 "You cancled the previus operation", when
my code reach
the frmFilterOn=true . I can not find out what operation it is talking
about and why, can anyone help me.
The code is on a popup search form, ID is autonumber that uniquely
identifies the record
Code:
Private Sub cmdUseAsFilter_Click()
Dim Criteria As String
Dim i As Variant
Dim frm As Form
Set frm = Forms(Me.OpenArgs)
' Build criteria string from selected items in list box.
Criteria = ""
For Each i In Me![lstShipInfo].ItemsSelected
If Criteria <> "" Then
Criteria = Criteria & " OR "
End If
Criteria = Criteria & " ID = '" & Me![lstShipInfo].ItemData(i) & "'"
Next i
' Filter the form using selected items in the list box.
frm.Filter = Criteria
frm.FilterOn = True
DoCmd.Close acForm, Me.Name
End Sub