PRB: "Can't Restore Field's Previous Value..." Error MessageArticle ID: Q120971Creation Date: 23-SEP-1994 Revision Date: 01-DEC-1996
The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
In Microsoft Access 97 or 7.0, you receive the following error message:
The value in the field or record violates the validation rule for the record or field.In Microsoft Access version 2.0, you receive the following error message:
Can't restore field's previous value; choose Undo Current Record or Undo Current Field from the Edit menu.CAUSE Visual Basic for Applications code canceled the BeforeUpdate event for a control in a record and Microsoft Access attempted to restore the field's original value. However, this value either violates a table-level validation rule or is a Null value in a field whose Required property is set to Yes.
RESOLUTION There are two ways to work around this behavior:
Steps to Reproduce Behavior
ValidationRule: >0 Sub ShipVia_BeforeUpdate(Cancel As Integer) ' Or Ship_Via_BeforeUpdate(Cancel as Integer) in version 2.0)
This error occurs because the option group's BeforeUpdate event was canceled. In canceling the event, Microsoft Access attempted to restore the original value of the field. Because there is no default value for the field, Microsoft Access tried to insert a Null value in the field, but the Null value violated the table-level validation rule (>0).
REFERENCES For more information about table-level validation, search the Help Index for "validation," or ask the Microsoft Access 97 Office Assistant. For more information about the Required property, search the Help Index for "Required property," or ask the Microsoft Access 97 Help Index. |
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.