以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  返回窗口问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=118341)

--  作者:nxqtxwz
--  发布时间:2018/4/29 22:48:00
--  返回窗口问题

我想在退出“物品申报”窗口时把没有保存的记录确认保存一下,下面的代码写在窗口事件的AfterClose事件中,点击关闭窗口后如果选择返回保存,做出选择,不知怎么能返回原来的窗口。

 

If Tables("物品申报").Current.Locked = False Then
    Dim Result As DialogResult
    Result = MessageBox.Show("您填写的记录没有保存,请您要返回保存所填写的记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        Forms("物品申报").Reject()
    Else
        Tables("物品申报").Current.Delete
    End If
End If


--  作者:有点甜
--  发布时间:2018/4/30 15:55:00
--  

beforeClose事件

 

If Tables("物品申报").Current.Locked = False Then
    Dim Result As DialogResult
    Result = MessageBox.Show("您填写的记录没有保存,请您要返回保存所填写的记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        e.cancel = True
    Else
        Tables("物品申报").Current.Delete
    End If
End If