Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing form
Message
From
24/10/2004 06:52:34
 
 
To
24/10/2004 04:55:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00954064
Message ID:
00954070
Views:
17
I have not read through your code, but in a multi user scenario, you have two options:
1. A very bad idea: you create the bill number in advance and flag the bill number as reserved. But then you have a problem if you for some reason do not complete the job, becuase then you must unflag the bill number, and may cause a hole in the sequence. The program to genereate bill numbers also must check for unflagged records, and use one if one is found. In other words, a whole lot of extra work.
2. The only real solution: you create the bill number AFTER the bill data is filled in, the very last thing you do before you finish the job.

>hi all,
>
>i'll try to insert two bills at the same time via same form via two pc
>
>1.i creat temp.table
>2.at my form i put a grid to insert my item via temp.table
>3.when i finish insert items, at save command i append all things from my grid to mstr.table
>
>but if mybill number is =14 at my pc,
>i can see the same number at another pc.
>
>how i can let every pc have another number of bill , when i open myform to add new bills
>via 2 pc or more.
>or if another way to do that
>
>this is the code..at save command
>
>USE MSTR EXCL
>  Append From Dbf('temp')
>  replace w1 with thisform.text14.value
>  replace w2 with thisform.text16.value
>  With thisform.grid1
>   .recordsource = ''
>   Select temp
>    Zap                && i get error message  any idea
>   *delete all
>
>   .recordsource = 'temp'
>   thisform.text1.SetFocus
>   thisform.refresh
>  endwith
>  ******************
> with thisform.Grid1
> .Recordsource = .Recordsource
>endwith
>
>  ********************************************
>  thisform.text1.value=space(10)
>  thisform.text2.value=ctod("  /  /  ")
>  thisform.text3.value=space(10)
>  thisform.text4.value=space(10)
>  thisform.text5.value=space(10)
>  thisform.text6.value=0
>  thisform.text7.value=0
>  thisform.text8.value=0
>  thisform.text10.value=0
>
>SELECT mstr
>SELECT MAX(BILLNO) FROM mstr INTO ARRAY laArray
>IF _TALLY > 0
>  THISFORM.TEXT1.VALUE = laArray + 1
>ELSE
>  THISFORM.TEXT1.VALUE = 1
>ENDIF
>With thisform.grid1
>   .recordsource = ''
>   Select temp
>   SET EXCLUSIVE off && i get error message  any idea
>   Zap
> * delete all
>   .recordsource = 'temp'
>   thisform.text1.SetFocus
>   thisform.refresh
>  endwith
>  thisform.grid1.refresh
>
>thanks
>m.qasem
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform