Allowing no duplicate entries in a field

Can I code a field so that each new record is unique?

If you can avoid two records to have the same value in a field, I think you can’t. If you want yo have an unique identifier for every records, you could use a Formula field with RECORD_ID(), or build an code field with an Autonumber field.