Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cell Comparison

Status
Not open for further replies.

milte

Technical User
Jan 30, 2002
20
US
Hello all,

I have a query from two tables. I want to compare certain cells in the two tables and highlight any changes where the cell doesn't match. I have the form built with the columns I want but the problem is that it highlights the entire column and not the particular cell. The code I'm using is:

Private Sub Form_Current()
If Me.UMD_current_AFSC <> Me.UMD_old_AFSC Then
Me.UMD_current_AFSC.BackColor = red
End If
End Sub

Any help would be greatly appreciated.

Milt
 
Hi Milt,

If you are using Access 2000 or greater.

Open your form in design view. Select UMD_current_AFSC, from the menu select Format>> Conditional Formatting.

From the Condition text box select Expression IS, in the text box to the right, type in or copy and paste this [UMD_current_AFSC]<>[UMD_old_AFSC]

Select Red from the Fill/BackColor button (Paint tin icon)

This should do it.

Bill
 
Thanks, Bill.

Works like a charm.

Man, where do you find this stuff??

Milt
 
Got another question. After thinking about this, probably should have went this route. What is the best way to have only the mismatches show up on the form? I have about 12,000 records and don't want to scroll through all of them looking for a red cell.

Milt
 
Never mind. I just added a where statement to the query.

Milt
 
Could we see the code? Thanks!

&quot;The nice thing about being a celebrity is that when you bore people, they think it's their fault.&quot; - Henry Kissinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top