Field change color when a date is about to be due or is past due

  • Thread starter Thread starter Guest
  • Start date Start date
I do almost the same thing in one of my applications. I use the OnCurrent
event but you might be able to use OnOpen or something else. You can also
use the dateadd function to get a date 2 weeks before the current date.

Private Sub Form_Current()

If Me.EffEndDT.Value < Date Then
Me.EffEndDT.BackColor = 255
Else
Me.EffEndDT.BackColor = 16777215
End If

End Sub

Hope this Helps

JR
 
Read up on Conditional Formating. To set the CF for a form field right
click on the field.
 
Where do i type that in

JR said:
I do almost the same thing in one of my applications. I use the OnCurrent
event but you might be able to use OnOpen or something else. You can also
use the dateadd function to get a date 2 weeks before the current date.

Private Sub Form_Current()

If Me.EffEndDT.Value < Date Then
Me.EffEndDT.BackColor = 255
Else
Me.EffEndDT.BackColor = 16777215
End If

End Sub

Hope this Helps

JR
 
Hey conditional formatting is COOL! Looks like I've been doing this the hard
way...

In conditional formatting under condition 1:

"Field Value Is" - "Less Than" - Date()
Then change the background color to red.

Then click "Add" to make another condition.

Under Condition 2:

"Field Value Is" - "between" - Date() - DateAdd("ww",2,Date())
Then change the background color to blue


HTH
JR
 
Is not working, do i put in the field name where it says Date. I put it
exactly as you type it and it doesn't work.
 
No, you don't put in the field name. Access knows which field you mean
because you right-clicked it and selected conditional formatting.

Try using just condition 1 to start.

if you have "Field Value Is" in the first drop down and "Less than" in the
second drop down and Date() in the last field

and

if you changed the background color to red on the "Preview of format to use
when condition is true" line

and

the date in your field is prior to today's date

Then I have no idea why it is not working.
 
Sorry about being vague early. Conditional Formating is only available
when using forms.
 
What can i do if i want it to show up in the table. Is there a different way
to do it to show up in the table instead of the form.
 
No. not in a table.

A table is a data repository, it is not supposed to be
exposed to users, who might totally garble its data. Think
of a table sheet view as a debugging aid for the programmer.
Use forms and reports to display the data in a table to
users.
 
Back
Top