找出重复项,标记红色
时 间:2018-05-10 21:07:49
作 者:雨泉 ID:39037 城市:金昌
摘 要:重复项
正 文:
今天在网站找到一个比较好的东东,自己研究了一下,现在将我实现的效果和大家分享一下!!
图 示:
具体代码如下:
Dim ctl As Control
Dim rst As DAO.Recordset
Dim str As String
Set rst = Me.sfrList.Form.RecordsetClone
If rst.RecordCount > 0 Then rst.MoveFirst
Do Until rst.EOF
If DCount("*", "TMP_牛群转群日期", "乳牛号='" & rst!乳牛号 & "'") > 1 Then
str = str & "乳牛号='" & rst!乳牛号 & "' or "
End If
rst.MoveNext
Loop
If Len(str) > 0 Then
str = Left(str, Len(str) - 4)
End If
For Each ctl In Me.sfrList.Form
If ctl.ControlType = acTextBox or ctl.ControlType = acComboBox Then
ctl.FormatConditions.Add acExpression, acEqual, 1
ctl.FormatConditions(0).Modify acExpression, , str
ctl.FormatConditions(0).BackColor = vbRed
End If
Next
Access软件网官方交流QQ群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access选项卡示例】Ac...(09.09)
- 【Access源码示例】按输入...(09.02)
- 【Access日期区间段查询】...(08.29)
- 【Access日期区间段查询】...(08.27)
- Access怎样才能实现日期时...(08.21)
- 【Access定时打开查询】A...(08.19)
- Access生成固定数量的记录...(08.13)
- Access怎样才能实现日期时...(08.12)
- Access利用导航窗体控件对...(08.03)
学习心得
最新文章
- Access表中的字段名、字段标题...(09.19)
- Access快速开发平台--更改“...(09.18)
- 【中秋及国庆优惠】Access培训...(09.15)
- Access如何将日期型的数值转换...(09.14)
- 英文输入法输入数据中存在单引号引起...(09.11)
- 【Access选项卡示例】Acce...(09.09)
- 让Access光标停留在指定的控件...(09.07)
- 关于Access查询条件里使用通配...(09.06)
- Access报表偷懒制作法--Ac...(09.05)
- Access快速开发平台--窗体数...(09.04)