以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于andalso或oralse 的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=104899)

--  作者:douglas738888
--  发布时间:2017/8/8 10:05:00
--  关于andalso或oralse 的问题

请教老师,下面代码,黄色部分怎样应用逻辑运算符,现在报错

 

If e.DataCol.Name = "部室名称" Then
    If e.NewValue Is Nothing Then
        e.DataRow("部室主任") = Nothing
    Else
        Dim dr2 As DataRow
        dr2 = DataTables("档案主表").Find("[工作部门] = \'" & e.NewValue & "\'And [工作职务] = \'主任\' AndAlso [工作职务] = \'主任T\'")
        If dr2 IsNot Nothing
            e.DataRow("部室主任") = dr2("员工姓名")
        End If
    End If
End If


--  作者:有点色
--  发布时间:2017/8/8 10:07:00
--  

dr2 = DataTables("档案主表").Find("[工作部门] = \'" & e.NewValue & "\'And [工作职务] = \'主任\' Or [工作职务] = \'主任T\'")

 

http://www.foxtable.com/webhelp/scr/1647.htm

 

http://www.foxtable.com/webhelp/scr/0102.htm