根据查找窗体设定的条件筛选主窗体的数据内容代码
时 间:2009-03-15 17:06:23
作 者:红尘如烟 ID:3459 城市:保定
摘 要:应用环境为:在弹出窗体中设定查找条件,然后据此筛选状体中的数据
正 文:
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
Access软件网官方交流QQ群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access怎么按每个年度里面...(07.03)
- Access自定义消息盒Msg...(04.28)
- Access怎么按每个月份里面...(03.09)
- Access怎么按季度来统计人...(02.26)
- Access怎么按年龄段来统计...(01.26)
- 【Access高效办公】上一年...(12.29)
- 用Access连续窗体制作的树...(11.03)
- 【Access高效办公】上一年...(10.30)
- Access制作的RGB转CM...(09.22)
学习心得
最新文章
- Access怎么按每个年度里面的周...(07.03)
- Access数据库备份不求人——用...(06.29)
- 如何更改快速开发平台上的窗体按钮(06.20)
- 用Excel模仿Access开发《...(06.17)
- Access快速开发平台导航箭头改...(06.15)
- Access2024官方下载,Ac...(06.11)
- Access快速开发平台--后台A...(06.03)
- 将bit字段的Null值更新为Fa...(06.01)
- 用VBA批量更改SQL SERVE...(05.30)
- 用SQL代码更改SQL Serve...(05.29)


.gif)
