The pre-reqs: I have a db that stores project requests by the department that requested them. Each request has an unique ID (project_num) and a priority number (dept_priority). I have never had more than 10 open requests for a given department at a time. I have a priorty form that includes a list box of open requests (for a selected dept) and a combo box with the numbers 1-20 as selection options. I have vba code written to assign the selected number from the combo box to the dept_priority field in my request table on click of a button.
The problem:: If another request for that department already has that priority number, I don't know of a way to change the priority of all the other requests accordingly. For example, if there were 5 requests and I would like to update my 4th priority to now be my first. I need to change the 4 to a 1, and then change my 1 to be 2, 2 to be 3 and 3 to be 4. The logic is beyond me.
Does anyone have a good vba solution for this issue? Any help would be greatly appreciated.
The problem:: If another request for that department already has that priority number, I don't know of a way to change the priority of all the other requests accordingly. For example, if there were 5 requests and I would like to update my 4th priority to now be my first. I need to change the 4 to a 1, and then change my 1 to be 2, 2 to be 3 and 3 to be 4. The logic is beyond me.
Does anyone have a good vba solution for this issue? Any help would be greatly appreciated.