Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Change font color in  a report field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
galsaba - 27 May 2005 18:13 GMT
How can I change the font color based on the value?
for example, say I have a field "age". Whenever the value is more than
50 I want that the data (age) will be in red fonts . Otherwise - black
fonts.

Thanks,

galsaba
fredg - 27 May 2005 19:16 GMT
> How can I change the font color based on the value?
> for example, say I have a field "age". Whenever the value is more than
[quoted text clipped - 4 lines]
>
> galsaba

Always post your Access Version number and also where you wish to do
this:in a Form, Query, or Report?

If you are using Access 97 post back with the above information.

Do you have Access 2000 or newer?
In a Form or Report, use the control's Conditional Formatting.
Select the control.
Click on Format + Conditional formatting

In a query or table, forget about it!

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

galsaba - 27 May 2005 21:41 GMT
I have Access 2000.
I am tgrying to do it with VBA.

galsaba
Baby Face Lee - 27 May 2005 22:34 GMT
Hi there,
You will need to use the 'On Format' event of the section of the report
where the age control is located.
The code might look something like this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtAge > 50 Then
 txtAge.ForeColor = 255 'red
Else
 txtAge.ForeColor = 0 ' black
End If

End Sub

Hope this helps.

Lee

> I have Access 2000.
> I am tgrying to do it with VBA.
>
> galsaba
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.