Version 1.2 Approx 0.6 MB (zipped) First Published 9 Nov 2023 Last Updated 14 Nov 2023
This is the second in a series of articles about highlighting objects on Access forms.
You could say it is a desperate attempt to get listed as one of this week's highlights in Mike Wolfe's Week in Review blog. It worked!
In this short article, I will demonstrate two simple 'tricks' showing how you can highlight the currently selected control without using any code.
The example app contains two forms demonstrating each approach:
1. Using Transparency
The short video (0:06) shows the effect in action:
To achieve this effect, open the form in design view and select all fields that you want highlighted.
Set the back color property to your preferred colour e.g. pale yellow (FFFF66) with the back style set to Normal
Now change the Back Style to Transparent and save the form. The set back colour is saved but is not normally in use.
Change to Form View and tab through the controls. As each gains focus, it shows the set colour.
This happens because back style becomes Normal (solid) whilst it retains focus.
That's it! Nothing else is needed.
This approach can only be used on textboxes and comboboxes as these are the only control types which have both a back style property and can receive focus.
2. Using Conditional Formatting
The first approach doesn't work so well for forms with a coloured background as a transparent control takes on the colour of its background
In such cases, a simple alternative is to use conditional formatting:
In design view, set the back style of the controls to Normal (solid) and set the back color to e.g. White (Background1)
Select each control, then click Conditional Formatting on the Format tab
Set the condition to Field Has Focus and choose your format conditions e.g. back color = pale yellow and text style = Bold
The end result is identical to the previous method
I have created a short video (3:31) to demonstrate both of these approaches.
You can watch the Highlight the Current Control - NO CODE REQUIRED! video on my Isladogs YouTube channel or you can click below:
If you liked the video, please subscribe to my Isladogs on Access channel on YouTube. Thanks.
Click to download: Highlight Current Control v1.2.accdb Approx 0.6 MB (zipped)
Download and unblock the 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.
Highlight Current Record in Continuous Form
Highlight Required Fields
Highlight Search Results
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 14 Nov 2023
Return to Example Databases Page
Return to Top