以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]判定当前行是否存在未填项?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=69750)

--  作者:新航程小何
--  发布时间:2015/6/10 12:02:00
--  [求助]判定当前行是否存在未填项?
各位老师,我想问一,有木有简单代码可以判定某一行记录是否存在未填项,目前采用的代码是
Dim t As Row = Tables("收购压榨计划").current
If t.IsNull(0) Or  t.Isnull(2) Or t.Isnull(3) Or t.Isnull(4) Or t.Isnull(5) Or t.Isnull(6) Or t.Isnull(7) Then
    MessageBox.Show("存在未填项,请核查!", "提示")
end if
,这样就会很麻烦的每次都要去数到底有几列,还得挨个写一遍数值,能不能直接全部判定完?
第二种情况,是这一条记录中只要判定除“审核人”、“审核时间”列为空的情况进行提醒?

--  作者:大红袍
--  发布时间:2015/6/10 12:07:00
--  
Dim t As Table = Tables("表A")
Dim cr As Row = t.Current
Dim Isnull As Boolean = False
If cr.IsNull("第三列") OrElse cr.IsNull("第五列") Then
    Isnull = True
Else
    For Each c As Col In t.Cols
        If cr.IsNull(c.Name) Then
            Isnull = True
            Exit For
        End If
    Next
End If
msgbox(isnull)