How do I flag (but still allow) duplicate entries in an Access?

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

Guest

I have an Access table that I would like to be able to set up so that when a
user
enters a duplicate entry into a field then entry is allowed but the user is
notified
that they are entering a duplicate record. Is there a way to configure this
for a table in Access?

Thank you,

erizzo
 
erizzo said:
I have an Access table that I would like to be able to set up so that when a
user
enters a duplicate entry into a field then entry is allowed but the user is
notified
that they are entering a duplicate record.

A little tongue in cheek:

CREATE TABLE Test (
no_key INTEGER NOT NULL,
by_checking_this_box_i_accept_this_may_result_in_duplicates YESNO,
CONSTRAINT test__dupes_ok_when_disclaimed
CHECK ((by_checking_this_box_i_accept_this_may_result_in_duplicates =
-1
OR (by_checking_this_box_i_accept_this_may_result_in_duplicates = 0
AND NOT EXISTS (
SELECT T1.no_key, COUNT(*)
FROM Test AS T1
WHERE Test.no_key = T1.no_key
GROUP BY T1.no_key
HAVING COUNT(*) > 1
)))
));

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top