Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
我在全局表事件的DataColChanged设置了这个代码:
dr1 =e.DataRow
Dim code As String
For Each dr As DataRow In DataTables("基础设置").DataRows
If e.DataTable.Name = dr("表名") Then
If e.DataCol.Name =dr("列名") Then
code = dr("代码编辑器") & vbcrlf
code = code & "Return Nothing"
Functions.add("zhi",code)
Functions.complie()
Functions.Execute("zhi")
Functions.remove("zhi")
Return
End If
End If
End If
Next
Functions.remove("zhi")
dr1是全局代码,然后我在表字段的"代码编辑器"的代码如下:
Dim dr As DataRow
Dim Filter As String
Filter = "[客户编号] = '" & dr1("客户编号") & "'"
dr = DataTables("订单").Find(Filter )
If dr IsNot Nothing Then '如果找到
dr1("客户名称") = dr("客户名称")
Else
dr1("客户名称") = Nothing
End If
可以执行,但会出来一个提示为:
dr1 =e.DataRow
dc =e.DataCol
dt=e.DataTable
Dim code As String
For Each dr As DataRow In DataTables("基础设置").DataRows
If e.DataTable.Name = dr("表名") Then
If e.DataCol.Name = "客户编号" Then
code = dr("代码编辑器") & vbcrlf
code = code & "Return Nothing"
Functions.add("zhi",code)
Functions.complie()
Functions.Execute("zhi")
Functions.remove("zhi")
Return
End If
End If
Next
Functions.remove("zhi")
如果项目属性里面这样设置,一点问题都没有
终于又想明白了.搞定.