Change backcolor of comboox in continue form

  • Thread starter poucedeleon via AccessMonster.com
  • Start date
P

poucedeleon via AccessMonster.com

I have a subform that has a combobox and a checkbox. I want the backcolor to
change if the checkbox is checked. This is a continues form so when I click
the checkbox all the rows change. can someone tell me how to have this only
effect the record/row I am working on?


Private Sub NoReportRequired_AfterUpdate()
If Me.NoReportRequired = -1 Then
Me.StaffID.BackColor = vbYellow
Me.StaffID.ForeColor = vbBlack
Else
Me.StaffID.BackColor = vbWhite
Me.StaffID.ForeColor = vbBlack
End If
End Sub
 
D

Douglas J. Steele

With a continuous form, making a change to a control on one row affects that
control on all rows.

You need to use Conditional Formatting.
 
L

Linq Adams via AccessMonster.com

To do this on a Continuous View form, you have to use Conditional Formatting
from the Format Menu.

In Design View, select the control to be formatted (StaffID) then goto

Format - Conditional Format

On the left select

Expression Is
then enter

[NoReportRequired]=-1

Now select the backcolor/forecolor you want.
 
P

poucedeleon via AccessMonster.com

Thank you for the help. I thought I could do it with code, but now i know
better.
Kevin

Linq said:
To do this on a Continuous View form, you have to use Conditional Formatting
from the Format Menu.

In Design View, select the control to be formatted (StaffID) then goto

Format - Conditional Format

On the left select

Expression Is
then enter

[NoReportRequired]=-1

Now select the backcolor/forecolor you want.
 
L

Linq Adams via AccessMonster.com

Formatting can be done in code on Single View forms, but almost always needs
to be done thru Conditional Formatting for Continuous/Datasheet view forms.
 

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