Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use tables
Message
From
30/11/2006 09:04:54
Mk Sharma
Shrishti Solutions
Mumbai, India
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Use tables
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01173669
Message ID:
01173669
Views:
58
i am using 2 dbfs in 10 data entry forms with SET FILTER, SET RELATION.
i am using default data session.

i am using same code in all the form, only filter is changed.

in form sales
set filt to status='SA'
in form purchase
set filt to status='PU'
in debitnote
set filt to status='DN'
in creditnote
set filt to status='CN'

in the load event of form "sales"

"inward.dbf" is main dbf, "inward1.dbf" is child using in grid.
Public oldproduct,oldrinward,sale2edit,sale2add, luRetval, oareacode, oareaname, osmancode, osmanname, ocompcode, ocompname
Public allowed, opstockid, unitname,LISTA,dfile1,mintag,min1tag, lsman, lgrid, myid
dfile1='pr'+Sys(3)
=usefile('LEDGER')
=usefile('LEDGER2')
=usefile('inward')
=usefile('inward1')
=usefile('customer')
=usefile('partycd')
=usefile('SCHEME1')
=usefile('SCHEME2')
=usefile('SCHEME3')
=usefile('pcode1')
=usefile('STOCK')
=usefile('TAXMAST')
=usefile('area')
=usefile2('rep')
Select scheme1
Select scheme2
Select scheme3
Select partycd
Set Order To ACCOMP   && ACCODE+COMPCODE
SELECT ledger
SET ORDER TO vno
GOTO top
SELECT ledger2
SET ORDER TO vno
GOTO top
Select stock
Set Order To pcodebatch
Select area
Set Order To areaname
Sele TAXMAST
Sele pcode1
Goto Top
Select customer
Set Order To acname
myid=Left(Id(),50)
Select rep
Do replrep
Select inward
Set Order To vno
Set Filter To
Goto Top
Do While vno<=0 And !Eof()
   If Status='SA' And machineid=myid And vno=0 And !savedrec
      Delete
   Endif
   Skip
Enddo
Select inward1
Set Order To vno
Set Filter To
Goto Top
Do While vno<=0 And !Eof()
   If Status='SA' And machineid=myid And vno=0 And !savedrec
      Do Case
      Case Not flg$'XLN'
         Do stkeffect With inward1.pcode, inward1.lotno, inward1.qty, inward1.Free, "OUT", "-", inward.godcode
      Case flg='N'
         Do stkeffect With inward1.pcode, inward1.lotno, inward1.qty, inward1.Free, "IN", "-", inward.godcode
      Endcase
      Replace inward1.stk With ((stock.Sin+stock.fin)-(stock.sout+stock.fout))
      Delete
   Endif
   Skip
Enddo

Select inward
Set Order To vno
Set Filter To inward.Status='SA'
Go Bottom
If salereco=0 And inward.Status='SA'
   salereco=Recno()
Endif
Select inward1
Set Order To reco1
Seek inward.reco1
=closfile("xxbill")
Select inward1
Copy Structure To xxbill
=usefile2('xxbill')
Select xxbill
Select inward
sale2edit=.F.
sale2add=.F.
rinwarddelete=.F.
allowed=.F.
LISTA=.T.
oldproduct=''
luRetval=''
lsman=.F.
lgrid=.F.
zprintcont=.F.
zprintyn=.F.
Store '' To oareacode, oareaname, osmancode, osmanname, ocompcode, ocompname, oldcnno
in the active event
On Key Label CTRL+R Modi Repo salbill
On Key Label CTRL+S Modi Repo salbill1
ON KEY LABEL CTRL+T MODI REPO csalbill
Select inward1
Set Order to reco1
SELECT INWARD1
Select inward
Set Order to vno
Set Filter To Status='SA'
SET RELATION OFF INTO INWARD1
SET RELATION TO RECO1 INTO INWARD1 ADDITIVE 
Select inward1
SEEK inward.RECO1
Select inward
If !Empty(salereco) And salereco<=Reccount('inward')
   Select inward
   Goto salereco
   Select inward1
   SEEK inward.RECO1
   Select inward
   Thisform.Refresh
Endif
Select inward1
Select inward
thisform.rcdrtn
Thisform.Refresh
Select inward
thisform.pageframe1.pAGE1.Refresh 
Select xxbill
in deactive event
ON KEY LABEL CTRL+R
ON KEY LABEL CTRL+S
ON KEY LABEL CTRL+T
SELECT inward
SET ORDER TO vno
*salereco=RECNO()
SELECT inward1
SET ORDER TO reco1
SELECT inward
thisform.Refresh
thisform.pageframe1.pAGE1.Refresh 
SELECT xxbill
should i use private data session for this.

when my user using 2 or 3 forms i am not getting the correct result.

warm regards,
mk.
Next
Reply
Map
View

Click here to load this message in the networking platform