Hi,
I am trying to write a function to automatically assign an ID like the way autonumber works, but with alphas. I want a 2 digit alpha assigned and I want to reuse and deleted like as if you compact the database everytime a record is removed.
The Table in this example is called division, it is made up of 2 columns, Division ID (which I want to populate with the alpha ID code) and Division.
I was thinking of opening the recordset in a function and ordering by the Division ID then running a loop that will check if the CHR value of righthand letter of the Division ID has a gap greater than 1 from the previous righthand letter of the Division ID's CHR value.
If it is, this will be the Division ID, if not it will generate the next Alpha ID.
Any ideas, I'm new with access and am currently stuck on ordering the record set and running a loop to check the gap between the CHR of the previous and current loops righthand division ID letter.
I am trying to write a function to automatically assign an ID like the way autonumber works, but with alphas. I want a 2 digit alpha assigned and I want to reuse and deleted like as if you compact the database everytime a record is removed.
The Table in this example is called division, it is made up of 2 columns, Division ID (which I want to populate with the alpha ID code) and Division.
I was thinking of opening the recordset in a function and ordering by the Division ID then running a loop that will check if the CHR value of righthand letter of the Division ID has a gap greater than 1 from the previous righthand letter of the Division ID's CHR value.
If it is, this will be the Division ID, if not it will generate the next Alpha ID.
Any ideas, I'm new with access and am currently stuck on ordering the record set and running a loop to check the gap between the CHR of the previous and current loops righthand division ID letter.