I hope somebody can help...
I have a textbox that allows a date to be entered.
This date is checked with the code below and the background colour is changed if the date is overdue from white, yellow or red (depending on weeks)
This works well but as it is in the AfterUpdate function of the textbox, when the user goes to another record the colour of the textbox remains the same as the previous, until the textbox is edited. I want this to be calculated when a record is displayed AND/OR when it is edited.
Is there a way of refreshing/requering the code, or putting it somewhere else aswell?
Thanks
I have a textbox that allows a date to be entered.
This date is checked with the code below and the background colour is changed if the date is overdue from white, yellow or red (depending on weeks)
Code:
Dim DateDifference As Integer
DateDifference = DateDiff("ww", ApplicationDate, Date)
ApplicationDate.BackColor = Switch(DateDifference >= 7, vbRed, (DateDifference >= 5 And DateDifference < 7), vbYellow, DateDifference < 5, vbWhite, DateDifference = 0, vbWhite)
Is there a way of refreshing/requering the code, or putting it somewhere else aswell?
Thanks
Comment