以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]空值个数问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=147629) |
||||
-- 作者:huanglan -- 发布时间:2020/3/20 17:00:00 -- [求助]空值个数问题 从"驾驶员", "带车人", "随行1", "随行2", "随行3", "随行4", "随行5"查找该行非空列的个数,填到出行人数中 代码如下:请大神帮忙改错 For Each c As DataCol In DataTables("用车登记").dataCols
此主题相关图片如下:微信截图_20200320170504.png [此贴子已经被作者于2020/3/20 17:05:38编辑过]
|
||||
-- 作者:狐狸爸爸 -- 发布时间:2020/3/20 17:17:00 -- For Each c As DataCol In DataTables("用车登记").dataCols Select Case c.name Case "驾驶员", "带车人", "随行1", "随行2", "随行3", "随行4", "随行5" Dim nms() As String = {"驾驶员", "带车人", "随行1", "随行2", "随行3", "随行4", "随行5"} Dim count As Integer For Each nm As String In nms If e.DataRow.IsNull(nm) Then count = count + 1 End If Next e.DataRow("出行人数") = count End Select Next
|
||||
-- 作者:huanglan -- 发布时间:2020/3/20 17:33:00 -- 此主题相关图片如下:微信截图_20200320173205.png 出现以下错误 |
||||
-- 作者:狐狸爸爸 -- 发布时间:2020/3/20 17:35:00 -- 表发上测试 |
||||
-- 作者:huanglan -- 发布时间:2020/3/20 17:43:00 --
|
||||
-- 作者:有点蓝 -- 发布时间:2020/3/20 20:14:00 -- Select Case e.DataCol.Name Case "驾驶员", "带车人", "随行1", "随行2", "随行3", "随行4", "随行5" Dim nms() As String = {"驾驶员", "带车人", "随行1", "随行2", "随行3", "随行4", "随行5"} Dim count As Integer For Each nm As String In nms If e.DataRow.IsNull(nm) = False Then count = count + 1 End If Next e.DataRow("出行人数") = count End Select |