A long time ago I found a function that highlights the current row in the continuous form and modified it to enhance its performance (from my opinion), I attached it to the isladogs example in this thread at this link.- One of the issues that was bothering me was the width of the text box that highlights the row, because it takes the same width as the form, it interferes with the rest of the controls and is difficult to work with while selecting or aligning them.
- The other issue is changing the background color of the focused text box, when the focus moves to any text box, the background of the selected text box becomes the same color as the BackColor property.
- The ability to customize the highlight color .
Everything that is required is explained in the code but in short these are the steps
1. Import the mdlHighlightRow module
2. Create a text box in the details section (it does not matter how wide) and modify its properties as follows- Control Source = [the name of the field that contains the unique values]
- Enabled = No
- Locked = Yes
- Background Style = Normal
- Special Effect = Flat
- Font Size = 1
- Tag = "UniqueValue"
- Send it to the back of other controls
3. Assuming that the textbox set up in the settings above was named [txtUniqueValue] Add the following to the form's OnCurrent event
- =HighlightRow([txtUniqueValue]) "OnCurrent event in the Properties sheet"
Or
- Call HighlightRow([txtUniqueValue]) " within the OnCurrent subprocedure "
That's all, you can download the attached file, try it out and provide any feedback or errors.
HighlightCurrentRecord.zip