Booking number not increasing after new booking is made

Hello All,

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.

How can this happen??

Thanks for looking into this.


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?

Instead of First item use :max + 1, So if last booking is 22, then next can be 23.

1 Like

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!!!

This topic was automatically closed after 14 days. New replies are no longer allowed.