根据查找窗体设定的条件筛选主窗体的数据内容代码
If Me.开始日期 > Me.截止日期 Then
MsgBox "您选择的开始日期晚于截止日期!", vbExclamation, "错误"
Else
Dim strWhere As String
strWhere = True
If Not IsNull(Me.开始日期) Then
If Not IsNull(Me.截止日期) Then
strWhere = strWhere & " and [车辆注册日期] between #" & Me!开始日期 & "# and #" & Me.截止日期 & "#"
Else
strWhere = strWhere & " and [车辆注册日期] >= #" & Me.开始日期 & "#"
End If
Else
If Not IsNull(Me.截止日期) Then
strWhere = strWhere & " and [车辆注册日期] <= #" & Me.截止日期 & "#"
End If
End If
If Not IsNull(Me.车号) Then
strWhere = strWhere & " and [车号] Like '*" & Me.车号 & "*'"
End If
If Not IsNull(Me.车型) Then
strWhere = strWhere & " and [车型] = '" & Me.车型 & "'"
End If
With Forms!主控面板!Child0.Form!车辆信息_child.Form
.Filter = strWhere
.FilterOn = True
End With
DoCmd.Close acForm, Me.Name, acSaveNo
(责任编辑:admin)
- ·Access窗体居中显示技巧
- ·Access中Tab键的使用说明【技巧】
- ·Access粘贴对象到Tab选卡上的技巧
- ·Access在窗体上显示当前记录和总记录数
- ·Access隐藏组合框的小箭头
- ·Access窗体属性表
- ·【技巧】Access选项组边框变为圆角边框
- ·Access函数me.sfmsub.form 提示子窗体
- ·Access中使用缩放对话框显示文本框文字
- ·access技巧-中文显示星期几的简单方法
- ·Access控件是否可见,可编辑,锁定的技巧
- ·根据查找窗体设定的条件筛选主窗体的数
- ·父子窗体的语法介绍
- ·access实现组合框联动详细教程
- ·Web Service在Access中的应用技巧
- ·Access窗体最大化,最小化等操作