>>>This may be too simplistic, but wouldn't SET CARRY automatically give you a way to do this?
>>>
>>>>My boss ask me to make a method allow the user to copy the previous
>>>>orderline information to new order!
>>>...snip
>>
>>but currently the orderline is showing the NewOrder wow....
>>In browse window, if env. setting CARRY = ON.
>>copy and replace the orderline.Order_no, that finish!
>>
>>Okey, let me try to match both replies....
>>kick out lSelected fields.
>>* at txtORder_no.dblclick
>>If messagebox("Are you sure to copy this record to new order?",4+32,;
>> "Copy from Existing Order!") = 6
>> set carry on
>> append blank in Orderline
>> replace order_no with alltrim(thisform.txtOrder_no.value)
>> tableupdate(Orderline)
>> set carry off
>>endif
>>
>>Then, ask user to change in the original grid and use confirm update!
>>Because if too much alternative method to replace value, the user will
>>confuse. For any changing on Orderline, back to the base grid to do!
>>
>>Is it OKey?!
>Really didn't expect that simple ! You were seeking for a method to copy just last rec entered (in fact current record). Well it's that simple but still I'm not a fan of "set carry" and prefer insert SQL vs Append.. this is my way :
>
If messagebox("Are you sure to copy this record to new order?",4+32,;
> "Copy from Existing Order!") = 6
> scatter memvar memo
> m.order_no=alltrim(thisform.txtOrder_no.value)
> insert into Orderline from memvar
> tableupdate(Orderline)
>endif
>Cetin
Agree, SET CARRY make me afraid. Insert-SQL will better to avoid blank record
if suddern crash on system.... or unexpected update on blank record... >_<"
Anyway, thanks both of you! ^_^"
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.