以文本方式查看主题

-  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=19974)

--  作者:yuri
--  发布时间:2012/5/26 1:04: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


--  作者:sloyy
--  发布时间:2012/5/26 23:57:00
--  

Select Case 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