Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
If e.DataCol.Name = "支出账户" Then
If e.NewValue IsNot Nothing Then
Dim Result As DialogResult
Result = MessageBox.Show("确定支出吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.No Then
e.DataRow("支出账户") = Nothing
End If
If Result = DialogResult.Yes Then
e.DataRow("录入日期") = Date.Today()
e.DataRow.Locked = True
End If
End If
End If
如上代码,输入支出账户时都会有提示(感觉很烦),那我这张表还有一个“支出项目”例,我的想法是如果”支出项目“包含“杂费”那么提示,不包含则不提示。
高手帮忙,
加个判断不就行了。
If e.DataCol.Name = "支出账户" Then
If e.DataRow("支出项目").Contains("杂费") Then
If e.DataCol.Name = "支出账户" Then
If e.DataRow("支出项目").Contains("杂费") Then
If e.NewValue IsNot Nothing Then
Dim Result As DialogResult
Result = MessageBox.Show("确定支出吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.No Then
e.DataRow("支出账户") = Nothing
End If
If Result = DialogResult.Yes Then
e.DataRow("录入日期") = Date.Today()
e.DataRow.Locked = True
End If
End If
End If
End If
代码很好用。但是原来的功能不能实现了(不包含杂费的行),即如果支出账户不是空值那么录入日期= Date.Today() e.DataRow.Locked = True