[ol][li]In the load of the form put:
SET DELETE ON && To make the deleted record disapear.[/li]
[li]In the click event of your delete button :
THISFORM.GRID1.DELETEMARK = .T.&& Which will make a little box (or field) next to each records on the lef-hand side.[/LI]
[li]You can click in the little box (it should turn black)[/li]
[li]Somewhere do a TABLEUPDATE, THISFORM.GRID.DELETEMARK = .F., and a thisform.refresh()[/li][ol]
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
In the rightClick event of the Grid.. put the code..
DELETE
SO when you run the form.. if you right click on the grid row.. that row will get deleted.. YOu can add code.. for safety..
Ans=MESSAGEBOX("Are you sure to DELETE",.... etc code
ANd delete or leave without deleting.
If you delete.. depending on SET DELE OFF the record will appear or not appear in the gird.. But to facilitate the correct display.. do a This.refresh()
Also SAKIP a record so that the pointer will be on a valid record.
Note: Both Mike's and ramani's solutions assume you aren't working with a read-only cursor or view as your data source - you can't delete records in these.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.