Page 1 Page 2



First Published 1 Dec 2023

The solution to a simple puzzle published in the first part of this article. It was designed to entertain you and make you think . . . BUT I also had a 'hidden agenda'.

A Quick Recap

The puzzle was set by one of my regular readers, Xavier (Xevi) Batlle.
He had contacted me recently about some minor modifications he had made to the continuous form used in my Highlight Current Record example app.

Xevi had made a few changes to the textbox which was now coloured green, made visible, locked and disabled. He had also duplicated the control! `

Modified Form
The current record is still highlighted as in the original form. `

Like any textbox controls which are both disabled and locked, the locked property takes priority for the appearance so it does not appear 'greyed out'.

In addition, controls which are both disabled and locked cannot be 'activated'. They do not allow the mouse cursor to be placed anywhere in the control

This applies to the left textbox but, as shown above, the right textbox CAN be activated with the mouse placed anywhere in the control and the control text selected.

So the puzzle Xevi set is very simple. What makes the controls behave differently and why does it happen?



The Solution

Conditional formatting had been added to the right textbox with a condition that is always true: Expression is 1 = 1 `

Conditional Format

In addition to setting the colour formatting, the enable/disable button is NOT clicked.
The control is therefore ENABLED which means the mouse cursor can be used anywhere in the control to 'activate it'

Conditional formatting always takes priority over the control properties set in the property sheet
However the control is still LOCKED as that cannot CURRENTLY be altered using the conditional formatting wizard.

NOTE:
1.   The status of the enabled/disabled button is far from obvious in the conditional formatting wizard.
      In the screenshot below, it is disabled but, in my opinion, that is not at all obvious
`
Conditional Format Disabled

2.   Two months ago, I made a request to the Access team to improve the conditional formatting wizard by adding the ability to also show/hide and lock/unlock controls.
      This would be particularly useful in continuous forms. This request will be considered by the Access team for a future update.

      At their suggestion, I also submitted it to the Access Feedback Portal. See Conditional formatting in continuous forms ยท Community (microsoft.com)

      If you agree with this suggestion, please click the link and vote for it. The more votes it gets, the greater the chances of it being implemented.



Download

Click to download the example app:   SetCursor.accdb     Approx 0.5 MB (zipped)

Download and unblockthe zip file.
For more details, see my article: Unblock downloaded files by removing the Mark of the Web

Unzip and save the ACCDB file to a trusted location.



Feedback

Please use the contact form below to let me know whether you found this article interesting/useful or if you have any questions/comments.

Please also consider making a donation towards the costs of maintaining this website. Thank you



Colin Riddington           Mendip Data Systems                 Last Updated 1 Dec 2023



Return to Access Blog Page




Return to Top