以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]简化一下  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=195734)

--  作者:hbkongxin
--  发布时间:2025/3/5 13:56:00
--  [求助]简化一下
If e.Row.isnull("客户") OrElse e.Row.isnull("花号") OrElse e.Row.isnull("色位") OrElse e.Row.isnull("米数") OrElse e.Row.isnull("面料") OrElse e.Row.isnull("底色") OrElse e.Row.isnull("浆料") OrElse e.Row.isnull("打印机台") OrElse e.Row.isnull("打印环境") Then

老师们,这怎么简化一下啊?

--  作者:有点蓝
--  发布时间:2025/3/5 14:18:00
--  
可以换种方式

dim ss() as string = {"客户","花号",....}
dim isn as boolean
for each s as string in ss
if e.Row.isnull(a)
isn=true
exit for
end if
next
if isn then
msgbox("有空值")
else
msgbox("全部没有空值")
end if

--  作者:hbkongxin
--  发布时间:2025/3/5 15:13:00
--  
for each s as string in ss
if e.Row.isnull(a)

这里的是不是要改成
if e.Row.isnull(s)

感谢老师

--  作者:有点蓝
--  发布时间:2025/3/5 15:27:00
--  
是的,手误
--  作者:hbkongxin
--  发布时间:2025/3/7 15:57:00
--  
老师,这里的msg怎么让它显示,是哪一格没填
--  作者:有点蓝
--  发布时间:2025/3/7 16:24:00
--  
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=150626
--  作者:hbkongxin
--  发布时间:2025/3/7 16:43:00
--  
If e.Col.Name = "完成" Then
    Dim ss() As String = {"业务员","客户", "花号", "色位", "数量", "面料", "底布", "浆料", "调色员", "打印机台" }
    Dim tf As Boolean
    For Each s As String In ss
        If e.Row.IsNull(s) Then
            tf = True
            Exit For
        End If
    Next
    If tf Then
        MessageBox.Show("需要完整输入")
        e.Cancel = True
    ElseIf e.Row("暂停") = True Then
        MessageBox.Show("已暂停")
        e.Cancel = True
    End If
End If

老师,这里的MessageBox.Show("需要完整输入")怎么修改,能显示哪个是空的

--  作者:有点蓝
--  发布时间:2025/3/7 16:48:00
--  
If e.Col.Name = "完成" Then
    Dim ss() As String = {"业务员","客户", "花号", "色位", "数量", "面料", "底布", "浆料", "调色员", "打印机台" }
    Dim tf As string
    For Each s As String In ss
        If e.Row.IsNull(s) Then
            tf = s
            Exit For
        End If
    Next
    If tf > "" Then
        MessageBox.Show("需要输入: " & tf)
        e.Cancel = True
    ElseIf e.Row("暂停") = True Then
        MessageBox.Show("已暂停")
        e.Cancel = True
    End If
End If