以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  “0”运算符后缺少操作数  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=121768)

--  作者:qinlao666
--  发布时间:2018/7/12 18:13:00
--  “0”运算符后缺少操作数
语法错误:“0”运算符后缺少操作数。
老师麻烦帮忙改下代码,谢谢
If user.group = "采购" Then
    Dim cnt1 As Integer
    Dim cnt2 As Integer
    Dim cnt3 As Integer
    Dim cnt4 As Integer
    cnt1 = DataTables("计划申请表").Compute("Count([_Identify])", "采购单号 is null And 审核 = true and 类型 = \'生产采购\'or 类型 = \'订单采购\' 0r 类型 = \'零星采购\'")
    cnt2 = DataTables("计划申请表").Compute("Count([_Identify])", "采购单号 is null And 审核 = true and 类型 = \'外协加工\'")
    cnt3 = DataTables("计划申请表").Compute("Count([_Identify])", "采购单号 is not null And 送检单号 is null And 类型 = \'生产采购\'or 类型 =\'订单采购\' 0r 类型 =\'零星采购\'")
    cnt4 = DataTables("计划申请表").Compute("Count([_Identify])", "采购单号 is not null And 送检单号 is null and 类型 = \'外协加工\'")
    If cnt1 > 0 Or cnt2 > 0 Or cnt3 > 0 Or cnt4 > 0 Then
        Forms("采购员").open
    Else
        Forms("采购员").close
    End If
End If

--  作者:y2287958
--  发布时间:2018/7/12 18:52:00
--  
看不出
--  作者:有点甜
--  发布时间:2018/7/12 19:21:00
--  

1、or 应该加上括号,如 (类型 = \'生产采购\' or 类型 = \'订单采购\' or 类型 = \'零星采购\')

 

2、你把or(偶r)写成了0r(零r)