hi,
i have a table called "ID Table" which can not have duplicate values of the person's medical record number (MR number), this field not being the last field of a composite PK.
I have created a query using the design wizard appearing below and I have added a 'Dummy' field to the table whose value is always '1'. the query was referenced in a macro which was linked to the 'after update' event of the 'MR Number' field BUT I WOULD LIKE IT TO BE ACTIVATED ONLY IF THERE ARE DUPLICATES FOUND.
SELECT [ID Table].[MR Number], [ID Table].[Last Name], [ID Table].[First Name], [ID Table].MI, [ID Table].Last_edited, [ID Table].Updated_by, [ID Table].Dummy
FROM [ID Table]
WHERE ((([ID Table].[MR Number]) In (SELECT [MR Number] FROM [ID Table] As Tmp GROUP BY [MR Number] HAVING Count(*)>1 )))
ORDER BY [ID Table].[MR Number];
IF THERE WERE SOME WAY THAT I COULD CONDITION THE MACRO TO TRIGGER THE DISPLAY OF THE QUERY WHEN THE SUM OF THE DUMMY COLUMN IS TWO OR GREATER??
“The philosophy of the school room in one generation will be the philosophy of government in the next." --- Abraham Lincoln
i have a table called "ID Table" which can not have duplicate values of the person's medical record number (MR number), this field not being the last field of a composite PK.
I have created a query using the design wizard appearing below and I have added a 'Dummy' field to the table whose value is always '1'. the query was referenced in a macro which was linked to the 'after update' event of the 'MR Number' field BUT I WOULD LIKE IT TO BE ACTIVATED ONLY IF THERE ARE DUPLICATES FOUND.
SELECT [ID Table].[MR Number], [ID Table].[Last Name], [ID Table].[First Name], [ID Table].MI, [ID Table].Last_edited, [ID Table].Updated_by, [ID Table].Dummy
FROM [ID Table]
WHERE ((([ID Table].[MR Number]) In (SELECT [MR Number] FROM [ID Table] As Tmp GROUP BY [MR Number] HAVING Count(*)>1 )))
ORDER BY [ID Table].[MR Number];
IF THERE WERE SOME WAY THAT I COULD CONDITION THE MACRO TO TRIGGER THE DISPLAY OF THE QUERY WHEN THE SUM OF THE DUMMY COLUMN IS TWO OR GREATER??
“The philosophy of the school room in one generation will be the philosophy of government in the next." --- Abraham Lincoln