Damon,

Just to add another thought. Checking accounts are managed in 
my accounting app, so all check numbers _must_ be accounted 
for. So whenever a user wants to write a "new" check, the system 
looks for a minimum criteria to establish that check entries are 
complete. So for example, if a payeeID, date, and at least one gl 
Account with an amount is present are not present in a check the 
app keeps returning to that check as a "new" check until it's 
completed or dealt with otherwise.

If the are no incomplete checks then:

Sel (max(CheckNum)+1) into vNum from Checks
Insert into Checks (CheckNum) val (.vNum)
-- Get autonumber val into vCheckID
Sel TblSerial into vCheckID from Checks Where Count = Insert
Edit Using Checks Whe TblSerial = .vCheckID

So the Check Number is meaningful only to the user as the app 
uses the autonum column TblSerial for identifying rows for editing 
or updating. And, depending on the requirements of the app, the 
user may be given the option of changing the Check Number (or 
PO Number) w/o ill effect to the balance of the app.

You could use a Unique constraint on the Po Number column with 
error trapping to catch those instances where two users do the sel 
(max) function simultaneously and just have the app cycle again.

Ben Petersen

On 16 Dec 2002, at 11:42, Damian wrote:

> 
> We have 8 users that access a purchase order system over a network. 
> The users are running RTime for Windows 1.851 installed on each of
> their workstations running windows 98 or windows 2000.  The database
> and programs are located on a separate computer running windows 2000. 
> When a new purchase is added to the system a number is automatically
> generated for it.  This is where the problem occurs.  We have a table
> that stores the current number and is accessed and incremented each
> time a new order is entered.  In the code, we set a lock on the table,
> fetch the current number, increment it by one, update the table, set
> the lock off and proceed to the po entry screen.
> 
> For some reason, every odd couple of days and entries the number is
> not calculated properly.  I have made a log file to monitor the
> assignments.  What I see in the log file is that everything is working
> fine for all of the users and then suddenly one of the users tries to
> enter a new po.  The number that is fetched from the table is
> incorrect.  I have seen it fetch a number that was used 10 POs ago or
> maybe a number that was used 3 POs ago.  I don't understand how.
> 
> I know that when RTime exits normally it erases the $$$ files and if
> not then they are left alone.  Is it possible that one of these is
> getting re-used and supplying incorrect information.
> 
> Any thoughts, suggestions, ideas are greatly appreciated.
> 
> Damian
> 
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In
> the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================ TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
> 


================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to