以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 多选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=180051) |
-- 作者:采菊东篱下 -- 发布时间:2022/9/25 21:27:00 -- 多选 我想分别勾选下面的业主月租停车、租户月租停车、外来月租停车、亲情临时停车、外来临时停车多选框,按批量勾选按钮,表中对应的行勾选列自动勾选,这样写只实现了一个多选框的条件,勾选两个以上,就不执行了,请教应如何改? Dim flt, flt1, flt2, flt3, flt4 As String If e.Form.Controls("CheckBox1").Checked = True Then flt1 = "[明细分类] = \'业主月租停车\'" ElseIf e.Form.Controls("CheckBox2").Checked = True Then flt2 = "[明细分类] = \'租户月租停车\'" ElseIf e.Form.Controls("CheckBox3").Checked = True Then flt3 = "[明细分类] = \'亲情临时停车\'" End If If flt1 > "" Then flt = "(" & flt1 & ")" End If If flt2 > "" Then If flt > "" Then flt = flt & " Or " End If flt = flt & "(" & flt2 & ")" End If If flt3 > "" Then If flt > "" Then flt = flt & " Or " End If flt = flt & "(" & flt3 & ")" End If For Each dr As DataRow In DataTables("批量勾选_Table1").Select("[车牌号码] is Not null And" & flt) dr("勾选") = True Next
|
-- 作者:有点蓝 -- 发布时间:2022/9/25 22:16:00 -- Dim Filter As String If e.Form.Controls("CheckBox1").Checked = True Then Filter = "[明细分类] = \'业主月租停车\'" end if If e.Form.Controls("CheckBox2").Checked = True Then If Filter > "" Then Filter = Filter & " Or " End If Filter = Filter & "[明细分类] = \'租户月租停车\'" end if If e.Form.Controls("CheckBox3").Checked = True Then If Filter > "" Then Filter = Filter & " Or " End If Filter = Filter & "[明细分类] = \'亲情临时停车\'" end if |