S
Sonia
Hi,
I am trying to enter information on a form (in this case a name). I have a
txt box that if I enter the name should first check for duplicates and if
there is a duplicate, alert me, but if not a duplicate allow me to continue.
This is the code I use:
Private Sub Client_Name_BeforeUpdate (Cancel As Integer)
If (Not IsNull (DLookup("[Client_Name]", "Client", "[Client_Name]='" &
Me!Client_Name & "'"))) Then MsgBox "This client already exists."
Cancel = True
Me!Client_Name.Undo
End Sub
The problem is that I'm working with full names and I wanted that the txt
box only appeared if the full name is a duplicate and not only a part of the
name. How can I do that?
Thanks.
I am trying to enter information on a form (in this case a name). I have a
txt box that if I enter the name should first check for duplicates and if
there is a duplicate, alert me, but if not a duplicate allow me to continue.
This is the code I use:
Private Sub Client_Name_BeforeUpdate (Cancel As Integer)
If (Not IsNull (DLookup("[Client_Name]", "Client", "[Client_Name]='" &
Me!Client_Name & "'"))) Then MsgBox "This client already exists."
Cancel = True
Me!Client_Name.Undo
End Sub
The problem is that I'm working with full names and I wanted that the txt
box only appeared if the full name is a duplicate and not only a part of the
name. How can I do that?
Thanks.