General information
Category:
Coding, syntax & commands
Hi,
I have a cursor which contains cSplit c(1),nItem_no,cProd c(5),cBatch c(5)
I have product with many batch no. I display the records into Grid. In Grid, 1st column is a button, field is cSplit,the 2nd is nItem_no,cProd,cBatch. When Click on the split button, I want the 1 record to be duplicated, and nItem_No will increased by one, then the following record nItem_no will increase by one as well. Such as
cSplit,nItem_No,cProd,cBatch
1 A
2 A B12 ----> Record Added
3 B
4 C
5 D
When I click on Split Button at 1st column of grid, I will call Split method
From the Split Method I call method Sort_No for sorting. It seek work ok but only for once time, It doesnt work when i add the second record for the same record. Any Suggestion?
In Method Sort_No
SELECT myCursor
INDEX ON cProd+STR(cno,2) TO cSort
SET ORDER TO cSort
SELECT myCursor
no_rec = 0
Go Top
Do While !EOF()
no_rec = no_rec + 1
Repl cno WITH no_rec
Select MyCursor
Skip
Endd
Click Method in split Button
SELECT myCursor
GO Thisform.recordno
IF cSplit = 'M'
Replace cno WITH cno+1
ln_no = cNO
lc_Prod = cProd
lc_split = cSplit
SELECT myCursor
Append Blank
Replace cNo WITH ln_no+1
REPLACE cprod WITH lc_prod
Replace cBatch with space(5)
replace cSplit WITH 'C'
Thisform.ShowGrid()
Endif
Thisform.Sort_no()
Thisform.Grid1.Refresh()
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only