You can do something like below in the closequery event of your window,
dw_1.accepttext()
if dw_1.modifiedcount() > 0 and cb_save.enabled = true then // u can use getitemstatus fn also based on your requirement here
li_i = MessageBox("title", "Do you want to save changes?", &
question!, YesNocancel!, 2)
choose case li_i
case 1
cb_save.triggerevent(click
case 2
return
case 3
dw_1.setfocus()
return 1
end choose
end if
Main Topics
Browse All Topics





by: gafoor78Posted on 2009-05-21 at 04:59:23ID: 24440317
You can use modifiedcount, getitemstatus function of datawindow to achieve this..see PB help for syntax and all.
write those scripts in closequery event of the window,
if something modified or added or deleted then put a messagebox and ask do you want to save changes,
then based on response save the datawindow and close or stop closing by returning 1 from closequery event.
Thanks,
Gafooor