D
DaveAP
Access 2003, Windows XP
I am trying to actively stop duplicates from being entered on a form but
cannot seem to get the code to work correctly (or I'm going about it all
wrong).
The GroupTable holds all of the active records and I would like the form to
show that a duplicate is being entered. The trick is there are seven
different forms and some can have this field be a duplicate, others cannot.
Example:
Form A222 cannot have the Claims_Tracking_Number duplicated on another form
while form MA61 can.
I've written a query to search for the duplicates on the forms that cannot
have dups:
SELECT GroupTable.Claims_Tracking_Number, GroupTable.[Name of Form]
FROM GroupTable
WHERE (((GroupTable.Claims_Tracking_Number) In (SELECT
[Claims_Tracking_Number] FROM [GroupTable] As Tmp GROUP BY
[Claims_Tracking_Number] HAVING Count(*)>1 )) AND ((GroupTable.[Name of
Form])=[Forms]![Startup_Split]![FormDataEntry]))
ORDER BY GroupTable.Claims_Tracking_Number;
The Name of Form is entered by the rep on a startup page from a combo box
and remains open in the background.
How do I get the query to run as an AfterUpdate and alert the rep once
he/she enters a Claims Tracking Number on the data entry form?
I am trying to actively stop duplicates from being entered on a form but
cannot seem to get the code to work correctly (or I'm going about it all
wrong).
The GroupTable holds all of the active records and I would like the form to
show that a duplicate is being entered. The trick is there are seven
different forms and some can have this field be a duplicate, others cannot.
Example:
Form A222 cannot have the Claims_Tracking_Number duplicated on another form
while form MA61 can.
I've written a query to search for the duplicates on the forms that cannot
have dups:
SELECT GroupTable.Claims_Tracking_Number, GroupTable.[Name of Form]
FROM GroupTable
WHERE (((GroupTable.Claims_Tracking_Number) In (SELECT
[Claims_Tracking_Number] FROM [GroupTable] As Tmp GROUP BY
[Claims_Tracking_Number] HAVING Count(*)>1 )) AND ((GroupTable.[Name of
Form])=[Forms]![Startup_Split]![FormDataEntry]))
ORDER BY GroupTable.Claims_Tracking_Number;
The Name of Form is entered by the rep on a startup page from a combo box
and remains open in the background.
How do I get the query to run as an AfterUpdate and alert the rep once
he/she enters a Claims Tracking Number on the data entry form?