Foxtable(狐表)用户栏目专家坐堂 → 禁止重复


  共有2363人关注过本帖树形打印复制链接

主题:禁止重复

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/16 8:53:00 [显示全部帖子]

代码要改成这样

 

 

Dim filter As String = "年度 = '" & Date.Today.year & "'"

If r("企业名称") = Nothing Then
   
    filter &= " and 企业名称 is null"
   
Else
   
    filter &= " and 企业名称 = '" & r("企业名称") & "'"
   
End If

If r("部门") = Nothing Then
   
    filter &= " and 部门 is null"
   
else
   
    filter &= " and 部门 = '" & r("部门") & "'"
   
End If

If r("岗位设置") = Nothing Then
   
    filter &= " and 岗位设置 is null"
   
Else
   
    filter &= " and 岗位设置 = '" & r("岗位设置") & "'"
   
End If

msgbox(filter)

Dim nr As DataRow = DataTables("年度安全目标").Find(filter)


 回到顶部