I Have uploaded a small db, would like to highlight same first names, and same surnames.(Different Colours) I am working in access 2003, I have entered the code in the conditional formatting feild on the report, Hope this is correct. When i entered as Code on detail section, On format event, i get a compile error.
I don't need to see your db, you can do it Let's walk through the error. What is the exact error message? Copy and paste the entire code here (wrapped in --> code tags <-- )
I knew it was going to be very slow but at least you now know how to construct a DCount() function well.
So to make things run much faster you can:
1. Create a totals query. Get a count per surname. You need three fields in this query: ID, Surname, Count(ID).
2. Save this query and join it to your report's query via the ID field
3. Use the Count field in the Conditional Formatting expression.
Hello. I am trying to get duplicate names to highlight in my report also. I can't get it to work. We have Access 2010 now. I am using this expression in the conditional fromatting; Nz(DCount("*","Formal Training Information 2 Query","[Name]='"&[Name]&"'"),0)>1