Checking duplicated records

neideb

Registered User.
Local time
Today, 00:33
Joined
Oct 9, 2001
Messages
42
To Pat Hartman if it is possible.
I went through several posts and finally I found something that will need my needs.
This post shows my problem but since I am not good in procedure writing I ask you if it is possible to send me an example of this solution or direct me to the right place where I can find it.
I have a table with Name, Middle Name and Last Name in different fields and I would like to have a code in another field, for example, BirthDate, that could verify the table and show me a dialogbox, before update that a person with those info is already in the table. Tks very much,
if you could reply by e-mail: neideb@gbl.com.br
 
I am not Pat Hartman!!!

However if I understand what you are needing to do. This should achieve what you are wanting. After changing the code below to match your info, place it in the AfterUpdate Event for the BirthDate field.


Dim Answer As Variant
If DCount("[Name]", "TableName", "[Name]=[Forms]![FormName].[Form]![Name]") _
And DCount("[Middle Name]", "TableName", "[Middle Name]=[Forms]![FormName].[Form]![Middle Name]") _
And DCount("[Last Name]", "TableName", "[Last Name]=[Forms]![FormName].[Form]![Last Name]") Then
Answer = MsgBox("This Customer is already in the Database", vbOKOnly, " Already in the Database!")
If Answer = vbOK Then Cancel = True
Exit Sub
End If

Edit To Fix Typo

[This message has been edited by donbettis (edited 11-15-2001).]
 
Hi Don, tks for your attention. I just printed your suggestion and will work on it. Let me ask you permission to post you back if I have any problem.
Tks a lot...
 
Dear Don, tks for your reply. I have received your sample and it is exactly what I need. For sure my job will be a lot better and light for me. I thank you for your help and hope this Forum be of continue success because we learn a lot from it. Best regards,
 
Glad I was able to help... And yes "WE" learn alot in these forums...
 

Users who are viewing this thread

Back
Top Bottom