Foxtable(狐表)用户栏目专家坐堂 → 多条件代码怎么简洁


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

主题:多条件代码怎么简洁

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


加好友 发短信
等级:小狐 帖子:337 积分:3225 威望:0 精华:0 注册:2020/2/25 23:12:00
多条件代码怎么简洁  发帖心情 Post By:2021/9/18 11:31:00 [显示全部帖子]

这样的代码怎么简洁写,

checkbox1,2,3 的值 排列组合,可以是任意一种组合方式,执行的代码相应的变化

 

 

if forms("窗口1").controls("checkbox1").checked =true   and   forms("窗口1").controls("checkbox2").checked =false and   forms("窗口1").controls("checkbox3").checked =false   then

dim dr as list(of datarow)= datatables("表A").select("第列 =         ") 

end if

if forms("窗口1").controls("checkbox1").checked =false   and   forms("窗口1").controls("checkbox2").checked =true  and   forms("窗口1").controls("checkbox3").checked =false   then 

dim dr as list(of datarow)= datatables("表A").select("第列 =         ")  

end if

if forms("窗口1").controls("checkbox1").checked =true  and   forms("窗口1").controls("checkbox2").checked =true  and   forms("窗口1").controls("checkbox3").checked =false   then 

dim dr as list(of datarow)= datatables("表A").select("第列 =    and    第列 =         ")  

end if

f forms("窗口1").controls("checkbox1").checked =true  and   forms("窗口1").controls("checkbox2").checked =true  and   forms("窗口1").controls("checkbox3").checked =TRUE   then 

dim dr as list(of datarow)= datatables("表A").select("第列 =    and    第列 =  and   第列 =       ")  

end if

.

.

.


 回到顶部