此主题相关图片如下:捕获2.png
我想分别勾选下面的业主月租停车、租户月租停车、外来月租停车、亲情临时停车、外来临时停车多选框,按批量勾选按钮,表中对应的行勾选列自动勾选,这样写只实现了一个多选框的条件,勾选两个以上,就不执行了,请教应如何改?
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