You canceled the previous operation

J

John Martin

No one has replied to my earlier message, so I am repeating my problem in more
detail as I am at my wit's end.

I created a relatively simple form, which allows the user to view and add
details of patients. I put a filter option control on the form so that the
patients could be filtered to those allocated to a chosen member of staff. This
worked perfectly.

Afterwards, I created various reports and, then, another form to select the
particular report required with another filter option control to limit the
selected report to the patients of a particular member of staff. This works as
expected.

When I next used the first form, when the code reached: Me.Filter = "[Case Open
to] = '2'" (the number (2 here) indicating a particular member of staff) and I
received an error message "Runtime error 2001 You canceled the previous
operation"

It seems that there is no "help" available from the program. This error happens
even if the second form mentioned has not been called. I do not understand what
the operation is that has been cancelled. I cannot see what I have done which
could have lead to the problem.

I would appreciate any help.

John Martin
 
A

Albert D. Kallal

If you open a form (or a report) in code, and that form load gets canceled,
then you get that nasty message.

Often, for example I open a report,a nd have a msgbox in the On-no data
event, and then set cancel=true.

So, you need to change the CALLING code

on error resume next
docmd.OpenReprot "myCoolRepot",avViewPreview,,"id = " & me.Id

The above will thus eliminate the cancel msg...
 
G

Guest

Hi John,

It appears to be related to the use of a criteria expression in some way. See my post on 3rd Aug for a fully elaboration of my story.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top