Colin, your code is also toggling the value. The difference is that you have used two different methods. The "slick" method to toggle the locked property and the mundane IF to toggle the color. For ease of understanding I used the same expression to toggle both properties. The issue is not the locked property since the original expression toggles that as long as the code is in the current event. The problem arises once you add the color change.
Yes I'm fully aware of that Pat.
The colour formatting was a quick and 'dirty' method to show rainbows the state of the control. It isn't needed and indeed I suggested removing it in a continuous form as it is confusing.
Of course, if the colour formatting is wanted, setting one of the colours as default means that can be toggled in one line.
My point was that the IsNull line does all that is necessary.... as was originally stated by ranman in post #2 and expanded upon by myself.
Despite your assertion in post #16, there is absolutely no need for If..Else..End If code in this case....though of course there's nothing wrong with using it either
Doc wasn't being pedantic in post #25. He was pointing out that using IsNull is effectively just a more concise version which does the same thing in this scenario.