ms access - Form set to be used for data entry attempting to create duplicate records causing error -


i have form set used data entry not working. when form opens blank when entered in field primary key field (visible not editable on form) sets value in use. rest of fields on main form remain blank have subforms fill values corresponding primary key. source of form single table linked database backend. table has no missing records. exact error when try close form is:

"the changes requested table not successful because create duplicate values in index, primary key, or relationship. change data in field or fields contain duplicate data, remove index, or redefine index permit duplicate entries , try again."

the same error occurring on form used updating records. error appears anytime entered field on subform.

any ideas appreciated! thanks

as understand, access inserts automatically new value autonumber field, , value exists. if so, run compact & repair, set autonumber next value max in field + 1

access generates new value autonumber fields using internal counter, not maximum value. internal counter can set inserting value autonumber field using, instance, insert sql statement, can done in cases during editing data in forms linked subforms. internal counter resets last inserted value + 1. after compact & repair counter resets actual maximum value +1.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -