If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Manage the counter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-02, 12:20
Ivan A. Ivan A. is offline
Registered User
 
Join Date: Jun 2002
Posts: 3
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.
Reply With Quote
  #2 (permalink)  
Old 06-21-02, 13:24
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Could you explain the use of this counter in greater detail ?
Reply With Quote
  #3 (permalink)  
Old 06-21-02, 17:58
Ivan A. Ivan A. is offline
Registered User
 
Join Date: Jun 2002
Posts: 3
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... ^_^
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On