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

Run-Time Error '2001'

Status
Not open for further replies.

sahaitu

Programmer
Jun 8, 2005
29
0
0
US
Can anyone help? I have the following situation:

I am trying to open a form blank so I set the for to data entry allowed and typed in the following code for my lookup combo box:


Dim strMyData As String
Dim strMyFilter As String
strMyData = Me![Combo42]
strMyFilter = "[LITID] = '" & strMyData & "'"
Me.DataEntry = False
Me.Filter = strMyFilter
***** Me.FilterOn = True ***** (highlighted)
End Sub


When I select from the combo box, I get the error "Run-Time Error '2001': You cancelled the previous operation. The Me.FilterOn = True portion of the code is then highlighted.

Can anyone help?
 
sahaitu,

There is nothing obviously wrong with your code. What event is this code running under? Is there any other code running in the form's module? Is [LITID] string or numeric data type?

Ken S.
 
Me.Filter = strMyFilter
If Me.Dirty The Me.UnDo
Me.FilterOn = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top