I have a table where I am trying to do a conditional primary key to group multiple rows (between 15-25 rows in the database) together. I would like to assign an autonumber to based on the value for field1 where field1 = 'INS'. I want that same autonumber value to be repeated until it finds field1 = 'INS' again then have the autonumber increase by 1 and so on. I've looked online for various different snippets of VBA code but none of it seems to give me what I want. Can anyone help steer me in the right direction?