The post Create Auto-Incrementing Code Numbers (Part 2) appeared first on Dynamics 101.
In our last post, we prepared the list that will serve as a basis for our auto-incrementing code numbers. Our code number will consist of three parts: a three-letter airport code, a three-letter department code, and a 5-digit code number starting with 00001 for each unique airport and department code combination. When a user opens a form and selects an airport code and a department code, our program will have to find and count all existing code numbers that match the user's selection, and create a new code number with the next available number. In other words, if there are 28 existing XXX-YY code numbers, the new generated number will be XXX-YY-00029.