以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教:怎样用SELECT CASE 语句写这段代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=19975)

--  作者:yuri
--  发布时间:2012/5/26 1:07:00
--  请教:怎样用SELECT CASE 语句写这段代码

请教:怎样用SELECT CASE 语句写这段代码

 

If e.IsFocusCell Then   
    If e.Col.Name = "产品名称" And e.Row.IsNull("订单号") = True Then
        e.Cancel = True
    ElseIf e.Col.Name = "订购件数" And e.Row.IsNull("产品名称") = True Then
        e.Cancel = True
    ElseIf  e.Col.Name = "到货日期" And e.Row.IsNull("订购件数") = True Then
        e.Cancel = True
    Else
    End If
End If


--  作者:y2287958
--  发布时间:2012/5/26 5:56:00
--  
If e.IsFocusCell Then
    Select e.Col.Name
        Case "产品名称"
            If e.Row.IsNull("订单号") = True Then
                e.Cancel = True
            End If
        Case "订购件数"
            If e.Row.IsNull("产品名称") = True Then
                e.Cancel = True
            End If
        Case "到货日期"
            If e.Row.IsNull("订购件数") = True Then
                e.Cancel = True
            End If
    End Select
End If
[此贴子已经被作者于2012-5-26 5:56:48编辑过]

--  作者:yuri
--  发布时间:2012/5/26 23:41:00
--  

非常感谢