View Full Version : Checking duplicated records


neideb
11-13-2001, 12:03 PM
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

donbettis
11-15-2001, 07:45 AM
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).]

neideb
11-15-2001, 08:32 AM
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...

donbettis
11-15-2001, 08:13 PM
neideb

I think I know what you are wanting to do...I have e-mailed you an example of what I think you are looking for...

Don

This is a reply to a questiion he left here...
http://www.access-programmers.co.uk/ubb/Forum4/HTML/004853.html

[This message has been edited by donbettis (edited 11-16-2001).]

neideb
11-16-2001, 04:48 AM
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,

donbettis
11-16-2001, 05:01 AM
Glad I was able to help... And yes "WE" learn alot in these forums...