以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何控制空行不能保存  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=68704)

--  作者:大红袍
--  发布时间:2015/5/22 17:44:00
--  

 判断空行代码

 

Dim Filter As String
For Each c As Col In CurrentTable.Cols
   Filter= Filter & "and " & c.name & " is null "
Next
Filter = Filter.Substring(3)
msgbox(filter)
If CurrentTable.DataTable.Find(filter) IsNot Nothing Then
    msgbox("有空行")
End If


--  作者:大红袍
--  发布时间:2015/5/22 18:21:00
--  

 你可以写到 BeforeSaveProject 事件

 

Dim t As Table = Tables("人员信息")

Dim Filter As String
For Each c As Col In t.Cols
   Filter= Filter & "and " & c.name & " is null "
Next
Filter = Filter.Substring(3)
If t.DataTable.Find(filter) IsNot Nothing Then
    e.Cancel = True
    msgbox("有空行")
End If


--  作者:Bin
--  发布时间:2015/5/23 9:04:00
--  
用 HasChanges http://www.foxtable.com/help/topics/0387.htm