Avatar of ccapital

asked on 

Highlighting a datetime field on an Access 2016 form when it is close to current time.

I have 6-7 fields displayed on an Access 2016 form. Each field contains a datetime value (only a time) and I would like to highlight the field that is nearest to the present time (BUT ahead of the current time). i.e. the next time to occur.

For example:

The fields are 02:00  06:00  10:00  14:00  18:00  22:00

The time is now 9:35AM and so the field which will be highlighted will be the 10:00 field. It is the next time to occur.

When the current time moves to 10:01AM then the 10:00 field would no longer be highlighted and the 14:00 one would be.

'Highlighting' will be by meaning of changing the text box's Back Color property.
Microsoft AccessVBA

Avatar of undefined
Last Comment
crystal (strive4peace) - Microsoft MVP, Access

8/22/2022 - Mon