I am pretty sure there must be a bug somewhere in the system as I have tried different ways approaching this, but it is still not working as it supposed to.
I have created a booking system. Every time a new booking is made a new booking number is being added to that booking. I guess the function is very simple:
I have tried it the other way around as well. Searching for the last item and sorting by the Booking_ID, Descending: No
After making a change (using the attached way or the oposit) it works perfectly with the next Booking (the Booking_ID is increased by 1) and as soon as the next booking is made the Booking_ID is saved to the DB with a Booking_ID = 1.
Just a guess, but any chance you didn’t refresh something so that the id you are now looking at is the new id+1. If not, and it didn’t do a new search, it’s possibly still at the existing id.
I think what you want is to always +1 the newest id. Not just the one you are currently referencing. Correct?
hohohoooo, lloks like the MAX +1 solved the case. See if this works on a long term.
Why the first item, descending +1 isn’t the right way of doing this? It should find the same number right?
Big thanks to you @melon!!!