Update or CancelUpdate without Edit or AddNew 
Author Message
 Update or CancelUpdate without Edit or AddNew

I find sometimes Access generates the following error...

Update or CancelUpdate without Edit or AddNew

with a bound form.  What is strange is to me is that there is no DAO (ie I'm
not calling a recordset.update method) going on begind the scenes to be
generating this message, since the form is bound to a table or query.  It is
relatively reproduceable by deleting (by selecting the text and clicking
delete or backspace) the contents of a combo box.  I have code which checks
if the user has tried to leave the record without filling in this box, and
if so makes them go back and fill it in.  If they then go back and choose a
valid selection from the list then try to leave the record or close the
form, they get the error.

This is not the first time I've seen this in a similar environment.  Anyone
have any ideas?



Wed, 17 Oct 2001 03:00:00 GMT  
 Update or CancelUpdate without Edit or AddNew
I've had this same problem.  The form I get this error on is using bookmark
clones to find records.  I get the error when I have searched for a record,
edited it, and then attempt to search for another record.  Any comments?

--
Paul Brower

"I Love DSL!"

Quote:
> I find sometimes Access generates the following error...

> Update or CancelUpdate without Edit or AddNew

> with a bound form.  What is strange is to me is that there is no DAO (ie
I'm
> not calling a recordset.update method) going on begind the scenes to be
> generating this message, since the form is bound to a table or query.  It
is
> relatively reproduceable by deleting (by selecting the text and clicking
> delete or backspace) the contents of a combo box.  I have code which
checks
> if the user has tried to leave the record without filling in this box, and
> if so makes them go back and fill it in.  If they then go back and choose
a
> valid selection from the list then try to leave the record or close the
> form, they get the error.

> This is not the first time I've seen this in a similar environment.
Anyone
> have any ideas?



Fri, 19 Oct 2001 03:00:00 GMT  
 Update or CancelUpdate without Edit or AddNew

Quote:
> I've had this same problem.  The form I get this error on is using bookmark
> clones to find records.  I get the error when I have searched for a record,
> edited it, and then attempt to search for another record.  Any comments?

Please post the code.

--
Paul Bredbury, http://dialspace.dial.pipex.com/brebs/



Fri, 19 Oct 2001 03:00:00 GMT  
 Update or CancelUpdate without Edit or AddNew
Exactly!

I was able to track down the offending code, although I'm still not sure why
it's doing it.  I have code that runs in the before update event of the
bound form to update the LastEditedByDate and for some reason this code is
generating the error.  There is code behind navigation buttons which use the
recordsetclone of the form to navigate to the next record.  When the new
bookmark is assigned to the form, the before update event is triggered and
the error is generated when trying to assign the current date to the field.
As a workaround, I placed the same code (to update the LastEditedByDate) in
the navigation button (ie removing it from before update event) and it works
just fine.

The code in the Before_update event is pretty straightforward:

Me.LastEdited = now()            <------- crashes here
Me.LastEditedBy = dbengine(0).username

I've also seem this same error when attempting to save a record after
changing the value in a limit-to-list combo box.  Even without using
recordset clones, the error was immediately generated trying to move to any
other field or close the form.  Hitting escape a few times to undo the
changes then re-attempting the change will sometimes work.  There is no
magical code going on in this case.  I have talked with Microsoft about this
and they are scratching their heads.  They suggested repair, compact, import
into new database, etc.  Nothing fixed it, hence why I'm searching the net.
What is strange to me is that the error message itself seems incorrect
because there is no addnew or edit method even being used.

---
Jeff

Quote:

>I've had this same problem.  The form I get this error on is using bookmark
>clones to find records.  I get the error when I have searched for a record,
>edited it, and then attempt to search for another record.  Any comments?

>--
>Paul Brower




Fri, 19 Oct 2001 03:00:00 GMT  
 Update or CancelUpdate without Edit or AddNew
I was able to track down the offending code, although I'm still not sure why
it's doing it.  I have code that runs in the before update event of the
bound form to update the LastEditedByDate and for some reason this code is
generating the error.  There is code behind navigation buttons which use the
recordsetclone of the form to navigate to the next record.  When the new
bookmark is assigned to the form, the before update event is triggered and
the error is generated when trying to assign the current date to the field.
As a workaround, I placed the same code (to update the LastEditedByDate) in
the navigation button (ie removing it from before update event) and it works
just fine.

The code in the Before_update event is pretty straightforward:

Me.LastEdited = now()            <------- crashes here
Me.LastEditedBy = dbengine(0).username

I've also seem this same error when attempting to save a record after
changing the value in a limit-to-list combo box.  Even without using
recordset clones, the error was immediately generated trying to move to any
other field or close the form.  Hitting escape a few times to undo the
changes then re-attempting the change will sometimes work.  There is no
magical code going on in this case.  I have talked with Microsoft about this
and they are scratching their heads.  They suggested repair, compact, import
into new database, etc.  Nothing fixed it, hence why I'm searching the net.
What is strange to me is that the error message itself seems incorrect
because there is no addnew or edit method even being used.

--
Jeff

Quote:


>> I've had this same problem.  The form I get this error on is using
bookmark
>> clones to find records.  I get the error when I have searched for a
record,
>> edited it, and then attempt to search for another record.  Any comments?

>Please post the code.

>--
>Paul Bredbury, http://dialspace.dial.pipex.com/brebs/



Fri, 19 Oct 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How CancelUpdate if form closed during Edit or AddNew

2. ado.net - addnew, edit, update, delete

3. how i can use the dbgrid with database {edit ,addnew,update or delete the data}

4. Help with DAO AddNew / Edit And Update in VB 4

5. Confusion with ADDNEW, EDIT, UPDATE

6. .Undo, .Edit, .Update, .AddNew Inconsistencies - freaking out!

7. AddNew without Update

8. AddNew without Update ??

9. Access 97: RecordSetClone & Error 3020 Update or CancelUpdate w/o AddNew or Edit

10. VB update my mdb file without .addnew or .edit and .update!!!

11. ADO cancelupdate after addnew on an empty recordset

12. problems with Addnew and CancelUpdate

 

 
Powered by phpBB® Forum Software