根据查找窗体设定的条件筛选主窗体的数据内容代码
时 间: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制作的RGB转CM...(09.22)
- Access制作的RGB调色板...(09.15)
- Access制作的快速车牌输入...(09.13)
- 【Access高效办公】统计当...(06.30)
- 【Access高效办公】用复选...(06.24)
- 根据变化的日期来自动编号的示例...(06.20)
- 【Access高效办公】按日期...(06.12)
- 合并列数据到一个文本框的示例;...(05.06)
- 通过命令按钮让Access列表...(04.24)

学习心得
最新文章
- Access快速开发平台--多行文...(09.28)
- 关于从Excel导入长文本数据到A...(09.24)
- Access制作的RGB转CMYK...(09.22)
- 关于重装系统后Access开发的软...(09.17)
- Access制作的RGB调色板示例(09.15)
- Access制作的快速车牌输入改进...(09.13)
- Access颜色编号管理数据库--...(09.10)
- 分享一个Access报表最后一页始...(09.03)
- 64位操作系统引用DAO出现加载D...(08.26)
- Access设置试用期截止日期默认...(08.15)