Conditional Formatting - Date Field

MattioMatt

Registered User.
Local time
Today, 22:24
Joined
Apr 25, 2017
Messages
99
I have a date field on a pop up form "frmOSRecords".

This displays the listed OS's against an Asset. I've added a conditional format to change the textbox that displays when the OS is in full support until to fill red if the date is in the past.

However it seems it will only full the textbox if the value is null. I've tried a few things:

1. Using Conditional Formatting - "Field Value Is"
Code:
Value < Date()

ValueCFProperties.PNG
ValueFromView.PNG

2. Using Conditional Formatting - Expression Is

ExpViewProperties.PNG
ExpFormView.PNG

3. VBA code on form load (this didn't work, nothing changed)

Code:
Private Sub Form_Load()
If Me.txtEval = 0 Then
    Me.FullSupportUntil.BackColor = vbRed
    Me.FullSupportUntil.ForeColor = vbWhite
Else
    Me.FullSupportUntil.BackColor = vbWhite
    Me.FullSupportUntil.ForeColor = vbBlack
End If
End Sub
 
it should work if your fullsupportuntil is a date field? or have you formatted as text in your recordsource query? If the latter, remove the format function and use the control format property instead
 
Hi CJ_London,

'FullSupportUntil' is a field on a bound continuous form. The form itself is based on a union query which is joining 4 other queries.

I've had to use padding of the FullSupportUntil field on queries 2,3 & 4 as the data isn't available in those tables only query 1 relating to query 1 on the union.

On the padded columns I've set the format to short date. With your response I wonder if it is the padded columns causing a problem?

DataType_Table.PNG
padded_DataType.PNG
 

Users who are viewing this thread

Back
Top Bottom