tb.SourceTable = DataTables("zzxmb1") '指定目录树表
tb.TreeCols = "xmname" '指定用于生成目录树的列
tb.SourceCols = "xmname|biaozhun|xmlx|xmsyfw|id" '指定数据来源列
tb.ReceiveCols = "xmname|jine|xmlx|xmsyfw|xmbh" '指定数据接收列
Tables("xszzbb").Cols("xmname").DropTree = tb.Build()
和datacolchanging
If e.DataCol.Name= "xmname" Then
MessageBox.Show("ccc")
Dim nc As DataRow = DataTables("zzxmb1").find("[xmname]='" & e.NewValue & "'")
If nc IsNot Nothing Then
e.DataRow("xmbh")=nc("id")
e.DataRow("jine") =nc("biaozhun")
e.DataRow("xmlx") =nc("xmlx")
e.DataRow("jgcode")=_UserName
e.DataRow("xueqi")= Tables("xqnf").Rows(0)("xueqi")
e.DataRow("year")= Tables("xqnf").Rows(0)("year")
e.DataRow("addtime")= Date.Now
e.DataRow.SetError("xmname","")
Else
' MessageBox.Show("不存在此资助项目")
e.DataRow.SetError("xmname","不存在此资助项目!")
e.Cancel = True
Return
End If
End If
后
datecolchanged会触发两次
If e.DataCol.Name= "jine" Then
If e.NewValue=0 Then
Forms("输入金额").Open()
Else
Forms("输入金额").Close()
End If
End If
请问如何设置可以只触发一次
[此贴子已经被作者于2016/9/21 17:08:33编辑过]