Duplicates

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

Guest

Hi

I have a table storing CVs received. Upon entering a first and surname I
need to know whether they already appear in my table. This will then require
me to look up the date of their last entry and whether to allow the new
entry. Setting the first and surname fields to not allow duplicates will not
allow me to enter their details again if the new CV is a more recent one,
allowing duplicates OK will not flag up that I already have them in the
system. What is the best way to get around this issue please?

Many thanks in advance

Kerry.
 
You could use a DCount function. If it returns zero then the record does not
exist

If DCount("*","[CV Received],"[FirstName] = '" & FirstName & "' And
[Surname] = '" & Surname & "'") = 0 then
msgbox "Does Not already exist"
else
msgbox "Already in Table"
end if

You can then use a DLookUp function to get the last entry date if they are
already in the table.
 
Hi Dennis

Many thanks for the answer. Am I best to put that as an after update event
on the form?

Many thanks



Dennis said:
You could use a DCount function. If it returns zero then the record does not
exist

If DCount("*","[CV Received],"[FirstName] = '" & FirstName & "' And
[Surname] = '" & Surname & "'") = 0 then
msgbox "Does Not already exist"
else
msgbox "Already in Table"
end if

You can then use a DLookUp function to get the last entry date if they are
already in the table.

Kerry said:
Hi

I have a table storing CVs received. Upon entering a first and surname I
need to know whether they already appear in my table. This will then require
me to look up the date of their last entry and whether to allow the new
entry. Setting the first and surname fields to not allow duplicates will not
allow me to enter their details again if the new CV is a more recent one,
allowing duplicates OK will not flag up that I already have them in the
system. What is the best way to get around this issue please?

Many thanks in advance

Kerry.
 
You could do. If they already exist then you will have to undo this new entry
(I assume you enter firstname and surname with the form bound to the table so
it would create a new record before you had performed your check) and then
goto the existing record to enter the new details.

Kerry said:
Hi Dennis

Many thanks for the answer. Am I best to put that as an after update event
on the form?

Many thanks



Dennis said:
You could use a DCount function. If it returns zero then the record does not
exist

If DCount("*","[CV Received],"[FirstName] = '" & FirstName & "' And
[Surname] = '" & Surname & "'") = 0 then
msgbox "Does Not already exist"
else
msgbox "Already in Table"
end if

You can then use a DLookUp function to get the last entry date if they are
already in the table.

Kerry said:
Hi

I have a table storing CVs received. Upon entering a first and surname I
need to know whether they already appear in my table. This will then require
me to look up the date of their last entry and whether to allow the new
entry. Setting the first and surname fields to not allow duplicates will not
allow me to enter their details again if the new CV is a more recent one,
allowing duplicates OK will not flag up that I already have them in the
system. What is the best way to get around this issue please?

Many thanks in advance

Kerry.
 

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

Similar Threads


Back
Top