以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]窗口表判断空值 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=118337) |
||||
-- 作者:天一生水 -- 发布时间:2018/4/29 18:45:00 -- [求助]窗口表判断空值 我想一次性弹出空值单元格信息,每个用换行符分隔。不是一个空值弹出一次。 就像这样: A002-第二列为空 A003-第三列为空 A006-第五列为空 怎样修改代码?谢谢! ------------------------------ 代码如下: For i As Integer = 0 To Tables("空值_Table1").Rows.Count -1 If Tables("空值_Table1").Rows(i).IsNull("第二列") Then msgbox(Tables("空值_Table1").Rows(i)("编号") & "-[第二列]为空") End If If Tables("空值_Table1").Rows(i).IsNull("第三列") Then msgbox(Tables("空值_Table1").Rows(i)("编号") & "-[第三列]为空") End If If Tables("空值_Table1").Rows(i).IsNull("第四列") Then msgbox(Tables("空值_Table1").Rows(i)("编号") & "-[第四列]为空") End If If Tables("空值_Table1").Rows(i).IsNull("第五列") Then msgbox(Tables("空值_Table1").Rows(i)("编号") & "-[第五列]为空") End If Next DataTables("表A").Save ![]() ![]()
[此贴子已经被作者于2018/4/29 18:46:16编辑过]
|
||||
-- 作者:有点甜 -- 发布时间:2018/4/30 16:11:00 -- Dim s As String = "" Dim t As Table = Tables("空值_Table1") For i As Integer = 0 To t.Rows.Count -1 Dim str As String = "" If t.Rows(i).IsNull("第二列") Then str &= t.Rows(i)("编号") & "-[第二列]为空," End If If t.Rows(i).IsNull("第三列") Then str &= t.Rows(i)("编号") & "-[第三列]为空," End If If t.Rows(i).IsNull("第四列") Then str &= t.Rows(i)("编号") & "-[第四列]为空," End If If t.Rows(i).IsNull("第五列") Then str &= t.Rows(i)("编号") & "-[第五列]为空," End If If str > "" Then s &= str.Trim(",") & vbcrlf End If Next msgbox(s) |