G
Guest
Docmd.Close is not catching duplicate key errors as it should. it simply closes the form without saving the record, with no indication that it has done so. It does, however, correctly save records when there is no duplicate key conflict error.
Direct entry into the table correctly triggers the error. It also fails to report/save on null required key errors.
If I force a save by inserting this code just before DoCmd.Close, the error is triggered and displayed correctly:
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
It is not a corrupted database; I just created a blank database with a single table and just enough code to generate a duplicate key error, and it does the same thing.
What am I missing? Is this another bug in Access 2002 SP3.
Direct entry into the table correctly triggers the error. It also fails to report/save on null required key errors.
If I force a save by inserting this code just before DoCmd.Close, the error is triggered and displayed correctly:
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
It is not a corrupted database; I just created a blank database with a single table and just enough code to generate a duplicate key error, and it does the same thing.
What am I missing? Is this another bug in Access 2002 SP3.