I use two dbf for all types of transactions as given below:
Main.Dbf contains Bill No., Voucher No and Date etc. while I store all types of transaction into another dbf Trans.Dbf. I usually use the following method to assign new voucher no./Billno when a new voucher is selected.
Store 0 to m_Bill_No
store date() to m_Date
Chk_NewBillNo() \\assigns new val to bill no when New voucher is selected
@row, col say "Date " get m_date
@row, col say "Bill No" gey m_Bill_No Valid Chk_Duplicate()
Read
Return
Function Chk_NewBillNo()
*----------------------*
sele Main
set order to 1 \\indexed: str(bill_no,7) + str(V_code,7)
set filt to bill_no = m_Bill_no .And. V_Code = m_V_Code
Go Bott
Store Bill_no to m_Bill_no
set filt to
Return .t.
Function Chk_Duplicate()
*-----------------------*
chk if m_bill_no exist ?
if exists then go for editing/deleting...
.....
.....
.....
return .t.
Now the problem is, when we select a new voucher it takes time to assign new bill no. my database contain appx. 8000 record and they will grow day by day. I know the filter command is very slow but I don't know the alternative methods. Please help how to overcome this problem. Or how can i make my program more efficient.
Thanks for your help
Main.Dbf contains Bill No., Voucher No and Date etc. while I store all types of transaction into another dbf Trans.Dbf. I usually use the following method to assign new voucher no./Billno when a new voucher is selected.
Store 0 to m_Bill_No
store date() to m_Date
Chk_NewBillNo() \\assigns new val to bill no when New voucher is selected
@row, col say "Date " get m_date
@row, col say "Bill No" gey m_Bill_No Valid Chk_Duplicate()
Read
Return
Function Chk_NewBillNo()
*----------------------*
sele Main
set order to 1 \\indexed: str(bill_no,7) + str(V_code,7)
set filt to bill_no = m_Bill_no .And. V_Code = m_V_Code
Go Bott
Store Bill_no to m_Bill_no
set filt to
Return .t.
Function Chk_Duplicate()
*-----------------------*
chk if m_bill_no exist ?
if exists then go for editing/deleting...
.....
.....
.....
return .t.
Now the problem is, when we select a new voucher it takes time to assign new bill no. my database contain appx. 8000 record and they will grow day by day. I know the filter command is very slow but I don't know the alternative methods. Please help how to overcome this problem. Or how can i make my program more efficient.
Thanks for your help