user16465317
user16465317

Reputation: 1

How can I avoid duplicate records with autonumber ID and how to increment autonumber ID sequentially in access?

I have an input table (including input ID and Input fields) and a type table (including typeID and type fields) where there is one to many relationship between them (one type ID to many inputs)... InputID and typeID are the primary keys and autonumbers. I have a data entry form where the user can select input from a combo box and then the correspodning type from another combo box. Every time I enter a new input and select a type ( from the existing types in the type combo box), I have a duplicated type in the type table as typeID is an autonumber (duplicate types). My first question is that how can I avoid generating duplicated records for type when user chooses from one of those existing types by keeping the typeID as an autonumber?

another question is that why autonumber filed doesn't increase sequentially when I add a new record from the form to the table? for example even if I had deleted some records seems like it has those IDs in the memory and increment from there not from the last existing ID in the table. I was trying to use compact and repair option but didn't work.

I aprpeciate your time and help in advance.

Upvotes: 0

Views: 201

Answers (0)

Related Questions