How to change field backcolor in continuous form (1 Viewer)

bruceblack

Registered User.
Local time
Today, 20:16
Joined
Jun 30, 2017
Messages
119
Hi all,

I am stuck quiet a bit with a simple little thing i try to do.

I have a continuous form with a table record source. All i like to do is that when i select a field (click on a control) the backcolor changes to green (for example). My expected result is that only that one specific field changes to green, but it does the entire column.

I am puzzled, since every row has a unique ID. I tried a few things, like Me. and Me! and Me.control... etc etc.
Nothing seems to work. Currently i have this (...im trying to make field A green) :


Private Sub A_Click()
lngGreen = 8179068
Me!A.BackColor = lngGreen
DoCmd.RunCommand acCmdSaveRecord
Else
End If
End Sub


But this changes the entire column to green. Please help :S
 

Minty

AWF VIP
Local time
Today, 20:16
Joined
Jul 26, 2013
Messages
10,371
As an explanation of what is happening - a continuous form only has one set of controls repeated many times.
So anything you do to a form control affects all the copies of that control on the form.

Search on the forum for highlighting records in a continuous form, there are a number of methods.
It will involve using conditional formatting.
 

bruceblack

Registered User.
Local time
Today, 20:16
Joined
Jun 30, 2017
Messages
119
As an explanation of what is happening - a continuous form only has one set of controls repeated many times.
So anything you do to a form control affects all the copies of that control on the form.

Search on the forum for highlighting records in a continuous form, there are a number of methods.
It will involve using conditional formatting.
Hi Minty. Thanks you! Will do.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:16
Joined
May 7, 2009
Messages
19,245
consider using Conditional Formatting.
and you need to apply it to an Unbound Textbox.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:16
Joined
May 7, 2009
Messages
19,245
see this demo.
 

Attachments

  • Highlight_ContinuousForm.accdb
    544 KB · Views: 79

MajP

You've got your good things, and you've got mine.
Local time
Today, 15:16
Joined
May 21, 2018
Messages
8,529
If not familiar with conditional formatting. You click on a control/controls and then on the Format Tab select Conditional Formatting. The Conditional Format Manager comes up. Then you can add rules in order of how they should be applied. One rule is for Has Focus.
condy.jpg
 

Users who are viewing this thread

Top Bottom