Part I - what color constant to use. In VBA you can present a decimal, octal, or hexadecimal constant. Hex constants are prefixed by ampersand-h and can be as many digits as needed up to 8 digits (for a long integer) or 16 (if you have a quad integer).
Most people set their displays to 16 million colors which is 24 bits. In this format, you can break up your colors into Red, Green, & Blue parts very easily. If you have a different color depth for your display, this does not work. Fortunately, these days most displays WILL handle this, and the default for LED and LCD will be 16 million colors.
Here is solid red expressed as 3 bytes: &h0000FF, which is decimal 255 in the low-order byte and nothing in the other bytes. This is solid green: &H00FF00; this is solid blue: &H0FF0000 (and the leading 0 is to prevent something called "sign extension".) If you mix solid red, solid green, and solid blue, you get solid white, which is &H0FFFFFF, six bytes of 255 in each byte (plus the guard against sign extension).
How do you get gray? Gray is just dimmer white. All of these hex values are gray, but different levels of brightness. &H0EEEEEE (still fairly bright), &H0808080 (about 50% gray), &H010101 (the dimmest possible gray that isn't truly black.) By now you have noticed the pattern. If you just express three digit-pairs of the same value in hexadecimal, you get some shade of gray - and unlike the popular novel, you can have 255 shades of gray.
Part II - WHEN do you do this? Well, the answer is "in some event code" - which leads to the question, WHICH event? And THAT depends on when you want this color change. I did something similar for my bound forms. I ran a "formatter" subroutine that compared the .Value and .OldValue for any bound field/control pairing. The event that fired my particular color change was the .LostFocus routine for the given control. Before I left that control, I checked to see if (.Value = .OldValue) and if not, the control's .BackColor got changed from white to (in my case) a shade of pink. The .ForeColor also changed, to a dark shade of maroon. EDIT: This only works this way for BOUND controls. You need a different approach for unbound controls.
If you are going to do this, you need to call your color formatter subroutine from TWO places - one for the .LostFocus routine and one (for each control) from the FormCurrent routine, so that the controls will be reset to white background or whatever else you were using at the time.
One last color lesson: How do you do "pink" or "maroon" colors? Answer: Start with knowing that white + red = pink, black + red = maroon. So you take a shade of gray, like &H0B0B0B0, and add red to it to get &H0B0B0FF. Or you take black (&H000000) and add less than the full amount of red. Like &H000020 or &H000040, two dark reds.