设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

根据文本框内数据更改显示颜色

1970-1-1 08:00| 发布者: Access911| 查看: 2642| 评论: 0

报表中60分以下用红字60分以上用兰字显示怎么做?
在主体的格式化事件里输入如下代码:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If TextBoxNumber < 60 Then 'TextBoxNumber为分数控件
TextBoxNumber.ForeColor = lngRed '改为红色
ElseIf TextBoxNumber > 60 and TextBoxNumber < 80 Then
TextBoxNumber.ForeColor = lngBlue '改为兰色
else
TextBoxNumber.ForeColor = lngBlack '改为黑色
End If
End Sub

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-7 09:27 , Processed in 0.065938 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部