Continuous Form Row Cursor

ddcessex

Registered User.
Local time
Today, 08:59
Joined
Jan 14, 2016
Messages
23
So, using a continuous form that is setup to resemble a datasheet grid view, I am missing a row cursor that highlights the whole row as the user clicks down through the rows.

Can anyone help me to achieve this please?

Thank you
 
1) In this case I would set the form property RecordSelectors to True. This property appears on the Format tab of the form in Design view. In that case, set the value to 'Yes.' This displays a bar on the left side of the detail section of the form that shows a caret type highlight in the currently selected row.

2) Another thing you can do is the set the Conditioinal Format of your controls to show a different colored background for the focussed control.
 
I suppose we have to manually emulate a row cursor?
 
I suppose we have to manually emulate a row cursor?

That's what #2, above, is about. There is no native method of doing this, in Access...you have to 'roll your own.'

To use Conditional Formatting for this, you have to let Access know which Row is the Current one. Assuming that you have a unique Field/Primary Key in your Record (we'll call it RecID in this example) you can do that by
  1. Adding an Unbound Control to you Form...name it txtHilite
  2. Set its Visible Property to No
  3. In Design View, while holding down <Shift> click on each Control to be formatted
  4. Click on Conditional from the Ribbon (or Menu, if your Access is pre-2007) and under Condition1, select Expression Is from the dropdown
  5. In the next Textbox, enter [txthilite]=[RecID]
  6. Select the BackColor you want, using the 'Paint Bucket' icon
  7. Click on OK
Now, in the code module, enter this:
Code:
Private Sub Form_Current()
 Me.txtHiLite = Me.RecID
End Sub
Linq ;0)>
 
Last edited:

Users who are viewing this thread

Back
Top Bottom