设有列表框“me.cmbReverson”,里有三个选项“全部”、“未回复”、“已回复”。编写代码如下:
if not IsNull(me.xxx) then
strWhere=strWhere & ........
...........
If Not IsNull(Me.cmbReversion) Then
Select Case Me.cmbReversion
Case "全部"
strWhere = strWhere
Case "未回复"
strWhere = strWhere & "([Reversion] = '是' AND [FinishedDate] is Null) and "
Case "已回复"
strWhere = strWhere & "([Reversion] = '是' AND [FinishedDate] Is not Null) and "
Case Default
MsgboxShow "非法输入,请从下拉列表中选择!", "错误"
Exit Sub
End Select
End If
If Len(strWhere) > 0 Then
strWhere = Left(strWhere, Len(strWhere) - 5)
End If