以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]请问这段代码有问题嘛?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=15888)

--  作者:gaoyong30000
--  发布时间:2012/1/16 13:08:00
--  [求助]请问这段代码有问题嘛?
放在窗口的beforeclose时间里的
Dim Result As DialogResult
With Tables("销售意向客户进度管制")
    If .Current.DataRow.RowState = DataRowState.Unchanged Then \'如果当前行未曾修改
        Return
    Else
        Result = MessageBox.Show("没有保存,是否放弃保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Result = DialogResult.no Then
            e.cancel = True
            Return
        Else
            .Current.Reject()
        End If
    End If
End  With 

[此贴子已经被作者于2012-1-16 13:08:48编辑过]

--  作者:狐狸爸爸
--  发布时间:2012/1/16 13:57:00
--  
Dim Result As DialogResult
With Tables("销售意向客户进度管制")
    If .Current.DataRow.RowState = DataRowState.Unchanged Then \'如果当前行未曾修改
        Return
    Else
        Result = MessageBox.Show("没有保存,是否放弃保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Result = DialogResult.Yes Then
            .Current.Reject()
        End If
    End If
End  With