>My boss ask me to make a method allow the user to copy the previous
>orderline information to new order!
>i.e. The client feel good and request all the same thing or have some
>little different only, How to make a copy!?
>
>Currently, in my Orders Form I have a PageFrame.
>First Page Tab is carry the all order information, date, cust_id...
>Second Page Tab is carry the grid to allow user to fill in Orderlines
>
>The problem is on Orderlines, How to show other orders with their
>itemKey selection and make a button to copy the previous item to new
>rows of current new orders!!
>
>Any Idea(s) or suggestion to make it?! the screen is already Cloudy...
>
>Other than copy old orders details, any common function(s) will
>business ppl request?!
Hi Justok,
Via an SQL you could collect the records+a new column for selection that will be shown to user and then insert a copy of it changing necessary parts.
select .f. as lSelected,a,b,c,.. ;
from mytables into cursor myCursor
use dbf("myCursor") in 0 again alias tcSelector
use in "mycursor"
select tcSelector
thisform.addobject("mygrid","grid")
with thisform.mygrid
.recordsourcetype = 1
.recordsource = "tcSelector"
.columncount=fcount("tcSelector")
.columns(1).addobject("mycheckbox","checkbox")
.columns(1).currentcontrol = "mycheckbox"
.columns(1).sparse = .f.
.left = 1
.top = 1
.visible = .t.
endwith
...
scan for lSelected
scatter memvar
m.aField = ChangedValue
insert into myInsertTable from memvar
endscan
Beware though this is an untested code to outline the strategy. How grid show etc may not fit to you.
Cetin