View Full Version : Manage the counter
| Is there someone who knows an algorithm in VBA to permit the management of a counter for making a reservation , includes cancels,etc...(or other suggestions). I've a multi-user application developed with Access 2000 and VBA, but I've some problem with sharing access to this counter.
Thanks a lot
Ivan A. |
Could you explain the use of this counter in greater detail ?
| I've created a sharing db where users can fill in a form, the counter should be number the forms compiled in a progressive order and follow it, if possible, with no gap. In the table that I've created, I didn't use Autonumber data type, but simply a numeric one.
Because the form is saved only at the end of the compilation, it could happens that someone else in the same time open a new form with my number before I've saved, but any form must have a distinct number. At the moment, I open the table and check the last number saved and I increment it (i+1). May be, the form should saved immediately when the number is assigned, so I'd be sure having the number (like a reservation), but it's possible that a user can reverse and abandon the input,canceling the form, leaving a gap between two numbers.
In the last case I thougth that could be possible to search in the table not assigned numbers, comparing the n and n+1 rows, so if n <> n+1, assign the free number to the new form (like a reservation).
Ivan A.
PS: the problem could be easy to solve, but I have no much experience, as the number of my posts shows... ^_^ |
vBulletin v3.5.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.