根据查找窗体设定的条件筛选主窗体的数据内容代码
时 间: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自定义消息盒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制作的RGB调色板...(09.15)
学习心得
最新文章
- 用SSMS将ACCESS中的表导入...(05.21)
- 自动编号用不好,系统迟早要乱!Ac...(05.21)
- Access原生开发VS快速开发:...(05.20)
- 不用记密码!用Access打造私人...(05.18)
- 如何用SSMS给SQL Serve...(05.16)
- 如何用SSMS在sql serve...(05.16)
- 多用户协作:链接Access和SQ...(05.16)
- Access做的一个《中华经典论语...(05.15)
- 直播预告|Access多用户协作终...(05.10)
- 盟威软件快速开发平台(05.07)


.gif)
