Conditional Formatting

B

Brandon

Hello All,

I'm working with (3) values on a form, UOM, Purch UOM, and
Issue UOM. What I'd like to do, is to change the BackColor
whenever the values for a given record are not equal. The
results that I keep getting are all or nothing, meaning
that if for the first record the UOM and Purch UOM are not
equal, all 1,000 records displayed on the form have the
BackColor turned yellow.

The code I've been trying to use is below...Can anyone
point me in the right direction?

If Me.UOM <> Me.Purch_UOM Then
Me.UOM.BackColor = RGB(255, 255, 0)
Me.Purch_UOM.BackColor = RGB(255, 255, 0)

Else

If Me.UOM <> Me.Issue_UOM Then

Me.UOM.BackColor = RGB(255, 255, 0)
Me.Issue_UOM.BackColor = RGB(255, 255, 0)

Else

Me.UOM.BackColor = RGB(255, 255, 255)
Me.Purch_UOM.BackColor = RGB(255, 255, 255)
Me.Issue_UOM.BackColor = RGB(255, 255, 255)

End If
End If


Thanks!
 

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