FORMAT DUPLICATE VALUES

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a field in a form based on a table (indexed, duplicates ok). i want to activate conditional formatting in order to highlight duplicated values (values that already exist in the field).

what should be the syntax of the expression?
 
HI,


Base the form on:

SELECT f1, f2, f3, f4, COUNT(*) As HowMany
FROM myTable
GROUP BY f1, f2, f3, f4


where f1, f2, f3, f4 are the fields you need to display and that define
"unicity". Those records that are duplicated will have a HowMany >1. You
can so base your conditional formation on that condition.


The query is not updateable. The date will be logically equivalent to a
ReadOnly access.




Hoping it may help,
Vanderghast, Access MVP



angie said:
i have a field in a form based on a table (indexed, duplicates ok). i want
to activate conditional formatting in order to highlight duplicated values
(values that already exist in the field).
 
where should i write the expression and how exactly?

Ο χÏήστης "Michel Walsh" έγγÏαψε:
 
Hi,


You write the expression in the query designer (or you can use it
graphically too: click on the summation button on the toolbar, the one with
the capital Sigma, a M rotated by 90 degree) and a new line, total, appear
in the grid. Drag the fields in the grid, keep the proposed "GROUP BY"; edit
the SQL text to add the last item in the SELECT clause: , COUNT(*) As
HowMany ). Save the query. Open the form, change its records source
from the table name, it is now, for the query you just did.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top