VBA Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have developed an application which is made up of several forms which are
loaded or opened using buttons from a main form. One of the forms (which is
rather complex) works great as long as I run it alone (without loading it
from the main form). However, if I load it from the main form, I get this
error when I change values in the criteria fields (the criteria fields
changes the underlying query and resets some of the field values on the form.
The error I'm getting is: Cancel or CancelUpdate without AddNew or Edit.

I can't find in my code or figure out what setting is causing this. Can
anyone help?

Thanks in advance
 
It is impossible to help much without seeing the code, but the error
is telling you what is happening. There is a pathway through your code
which gets you to a .Cancel or .CancelUpdate operation on a record
which you are not actually trying to modify. I wonder if you are
unexpectedly getting into some error handling code either as a result
of execution "falling through" into it or as a result of an error that
you did not expect and/or have not handled appropriately.

I have developed an application which is made up of several forms which are
loaded or opened using buttons from a main form. One of the forms (which is
rather complex) works great as long as I run it alone (without loading it
from the main form). However, if I load it from the main form, I get this
error when I change values in the criteria fields (the criteria fields
changes the underlying query and resets some of the field values on the form.
The error I'm getting is: Cancel or CancelUpdate without AddNew or Edit.

I can't find in my code or figure out what setting is causing this. Can
anyone help?

Thanks in advance

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Peter - Thanks for the response. I have searched the code for the entire
project and can not find .Cancel or .CancelUpdate anywhere. Could something
else be causing this such as a property setting on a form or control?

Mike
 
Did you setup VBA to break on all errors and try steppin through the
code? (See earlier post)
 
Back
Top