
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/