Conditional Formatting a date

gream0604

New member
Local time
Yesterday, 20:04
Joined
Oct 5, 2011
Messages
6
Hello all,

I am stuck on conditional formatting of a date. A field on a subform is auto populated with the now() command, and gives the following output: 23/01/2012 16:16:17

I am trying to apply conditional formatting to that field so that it turns a different colour if the date is the same as todays date. I have tried using date() in both the expression, and 'is like' section of conditional formatting, but it is notpicking it up becasue of the time value.

I think i need some sort of contains, or find command, but not sure of how to do this. Any help would be greatly appreciated!!

Matt
 
As dates are stored as a number where the part before the comma is the number of days since 1/1/1900 an the time part is after the comma (1 = 24h).
Test if the date part is the same like:
Code:
If split(cdbl(YourFieldnameHere),",")(0) = cdbl(date()) then ...
 
Actually, it can be simply done like this in CF:
Code:
[COLOR=Blue]Expression Is[/COLOR]
DateValue([FieldName]) = Date()
 
And unless the Subform is a Single View Forms, which is rare, it really has to be done using Conditional Formatting from the Format Menu, rather than using VBA code.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom