Editing values in columns depending on the choice of the primary key in the first section of the form

Hey, I have a problem. Namely, I have a form in which I choose the main key first (this way I want to mark which fields I want to edit in the following fields). Unfortunately, when I want to save the form, I am informed that the key already exists.

A key column value cannot occur more than once in the key column; no two rows can have the same key column value.

See also:

Not sure if I understand you correctly.
Are you looking for something like this?