How to Change Background Color of Specific Records in Continuous F

G

Guest

I have: A continuous form with a checkbox in each record.

I want: The background color of the record to change, depending on the value
of the checkbox (False = White, True = Red).

Any suggestions?
 
F

fredg

I have: A continuous form with a checkbox in each record.

I want: The background color of the record to change, depending on the value
of the checkbox (False = White, True = Red).

Any suggestions?

Select each control that you wish to change the back color on.
Click on Format + Conditional Formatting

Set Condition1 to
Expression is
write in the next box
[CheckControlName] = -1

Select the Red back color.
Save the changes.
 
D

Douglas J. Steele

Assuming you're using Access 2000 or newer, look into Conditional
Formatting.
 
G

Guest

fredg said:
I have: A continuous form with a checkbox in each record.

I want: The background color of the record to change, depending on the value
of the checkbox (False = White, True = Red).

Any suggestions?

Select each control that you wish to change the back color on.
Click on Format + Conditional Formatting

Set Condition1 to
Expression is
write in the next box
[CheckControlName] = -1

Select the Red back color.
Save the changes.

Is there a way to format the record background (not the control background)?
I tried the code below, but this changes the background of all records on the
form. I want to change the background color of only the records where the
checkbox is checked.

If TRShade.value = True Then
Me.Detail.BackColor = 12632256
Else
Me.Detail.BackColor = 16777215
End If
 
F

fredg

fredg said:
I have: A continuous form with a checkbox in each record.

I want: The background color of the record to change, depending on the value
of the checkbox (False = White, True = Red).

Any suggestions?

Select each control that you wish to change the back color on.
Click on Format + Conditional Formatting

Set Condition1 to
Expression is
write in the next box
[CheckControlName] = -1

Select the Red back color.
Save the changes.

Is there a way to format the record background (not the control background)?
I tried the code below, but this changes the background of all records on the
form. I want to change the background color of only the records where the
checkbox is checked.

If TRShade.value = True Then
Me.Detail.BackColor = 12632256
Else
Me.Detail.BackColor = 16777215
End If

You wish to conditionally change a continuous form's Detail section
color?
You can't, but you can fake it.

Add an unbound text control to the detail section. Size it to cover
the entire detail section and all controls in it.
Delete it's attached label.
Select this new control.
Set it's BackStyle property to Normal.
Click on Format + Send to Back.
While it's still selected, click on Format + Conditional Formatting
Set Condition1 to
Expression Is
Write
[CheckControlName] = -1
in the dialog box.
Select the back color.
Save the changes.

The above will change just the appearance of the detail back color,
not the individual controls within the detail section.
If you also wish to change the individual controls, follow my previous
post suggestion as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top