nosferatu26
Registered User.
- Local time
- Today, 08:58
- Joined
- Jul 13, 2015
- Messages
- 57
Hello,
I currenlty have a table for all revision letters that get assigned to a given project. In my form, there is a listbox containing all of the projects and the user should have the ability to press a button and add a new revision to it. For example, when a new project is created, it automatically defaults to rev "-". Then if the user wants to create a new rev it would create a new record in their joining table with a rev of "A" instead of "-". The next one would be "B", and so on. This would continue all the way to rev "Z", then, in this case, upon the button getting pressed it would create a new rev of "AA", then "AB", and so on.
I have been having a little trouble with coding this but have been trying to incorporate each ASCII value into it and find a mathematical correlation to these operations.
I have also thought about just prepopulating the rev table with all of these values then just auto incrementing the id but I thought it would be ideal to be able to check if the next rev value exists, then if it does, assign it. otherwise, create it and then assign it to the new record.
Most of it I think is do able. what i want most help on however is the part for when a rev is at "Z" or "AZ", to dynamically get the correct next letter.
I apologize for maybe wording this problem in a confusing matter but if anyone can help me come up with the code for something like this i would be extremly grateful.
I currenlty have a table for all revision letters that get assigned to a given project. In my form, there is a listbox containing all of the projects and the user should have the ability to press a button and add a new revision to it. For example, when a new project is created, it automatically defaults to rev "-". Then if the user wants to create a new rev it would create a new record in their joining table with a rev of "A" instead of "-". The next one would be "B", and so on. This would continue all the way to rev "Z", then, in this case, upon the button getting pressed it would create a new rev of "AA", then "AB", and so on.
I have been having a little trouble with coding this but have been trying to incorporate each ASCII value into it and find a mathematical correlation to these operations.
I have also thought about just prepopulating the rev table with all of these values then just auto incrementing the id but I thought it would be ideal to be able to check if the next rev value exists, then if it does, assign it. otherwise, create it and then assign it to the new record.
Most of it I think is do able. what i want most help on however is the part for when a rev is at "Z" or "AZ", to dynamically get the correct next letter.
I apologize for maybe wording this problem in a confusing matter but if anyone can help me come up with the code for something like this i would be extremly grateful.