Error after duplicate in primary key
I think that if there is a duplicate in the Primary Key column then before you leave that box, it should let you know there is an error. Not error after you finish the entire row.
You can trap for this error (and similar errors) in the Form Error Event - which this particular error is rendered.
Grover Park George commented
This can be implemented as a design feature in your specific database. Please visit one of the many Access support sites which have many members dedicated to helping you address specific design requests like this.