Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing form
Message
From
24/10/2004 08:10:44
 
 
To
24/10/2004 07:40:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00954064
Message ID:
00954073
Views:
24
Hi Mohammed,

sorry, but I don't have time to go into details, but I will give you a brief listing of the correct sequence:
1. Form to fill in the billing details, but WITHOUT anu bill number so far
2. The "finish billing" button is pressed, or whatever solution you have to finish the billing detail
3. You calculate the next bill number AND lock the table for a while, here is a snippet from my own program
Function GetNextBillNo
local lcAlias, lnReprocess, lnBillNo
lcAlias=select() && remeber alias
lnReprocess=SET('REPROCESS()') && remember value
SET REPROCESS TO 1 && Retry evey one second
SELECT 0 && find an available work area
USE Billings order BillNo again && BillNo is an index tag on BillNo
DO WHILE .T.
   GO BOTTOM && this record holds the highest number
   lnBillNo=billings.BillNo
   APPEND BLANK
   IF !RLOCK() && Someone else is doing exactly the same, so he comes first
      WAIT 'Someone else is billing, you must wait!' WINDOW NOWAIT
      LOOP && wait a second and try again
   ENDIF
   REPLACE Billno with lnBillno + 1
   lnBillNo=billings.BillNo && lnBillNo is the next bill number
   EXIT
ENDDO
USE && Close
WAIT CLEAR && In case any Wait window is open
SET REPROCESS TO lnReprocess && always restore
SELECT (lcAlias) && always restore
RETURN lnBillNo
4. Now you have the bill number, and can continue the process


>hi,
>thank you for reply,
>
>i need favor from you if you can,and if you have atime
>
>i need a sample with two or more tables ,how you make sharing between those tables ,
>and how i can insert mybills via more one pc.via myform
>any example ,
>
>if you do it,or not i appretiate
>remark.you can send it via myemail as a zip file.
>
>thanks alot,
>
>m.qasem
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform