Continuous form - code updates all records instead of one!

B

Bob Waggoner

On a continuous form, I have the following code:

Private Sub pBin822IANCAudited_AfterUpdate()
If pBin822IANCReadytoAudit = True Then
pLI822IANCCARNO.BackColor = 255
Else
pLI822IANCCARNO.BackColor = -2147483643
End If
End Sub

The problem is, if I make any of them true, they all go true and the back
color goes red or white for all of them. How do I limit the back color change
to the one record in the continuous form?
 
B

Bob Waggoner

I'm afraid that didn't work either. I converted my db from 97 to 2003 to try
this and it still updates all records at the same time. Here's the code I'm
using in the conditional formating:

Condition 1: [me]![readytoaudit]=True
Then, I selected forecolor red
Condition 2: [me]![audited]=False
Selected normal (black) forecolor.

Bob
 
K

Ken Sheridan

Bob:

Try setting the first conditional formatting expression to:

[readytoaudit]

and the second to:

Not [audited]

Me is only used in VBA. It actually refers to the current instance of the
class in which the code is running, so its not used as part of the form
definition.

Ken Sheridan
Stafford, England

Bob Waggoner said:
I'm afraid that didn't work either. I converted my db from 97 to 2003 to try
this and it still updates all records at the same time. Here's the code I'm
using in the conditional formating:

Condition 1: [me]![readytoaudit]=True
Then, I selected forecolor red
Condition 2: [me]![audited]=False
Selected normal (black) forecolor.

Bob


Duane Hookom said:
Use Conditional Formatting from the Format menu.
 

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