// Accept the last data entered into the datawindow
dw_master.AcceptText()
//Check to see if any data has changed
IF dw_master.ModifiedCount() > 0 THEN
li_rc = MessageBox("关闭提示","您已经对数据库做了修改,保存您所做的修改吗", Question!, &
YesNoCancel!, 3)
//User chose to up data and close window
IF li_rc = 1 THEN
Window lw_window
lw_window = w_frame.GetActiveSheet()
lw_window.TriggerEvent("ue_update")
RETURN 0
//User chose to close window without updating
ELSEIF li_rc = 2 THEN
RETURN 0
//User canceled
ELSE
RETURN 1
END IF
ELSE
// No changes to the data, window will just close
RETURN 0