I have a query [qryRecords] with field names [strFirstName] and
[strLastName].
When I access any given record in form "test", I want the user to be
alerted if there is more than one record with the same first name and
last name.
This is different from most posts I've read in that this doesn't happen
upon data entry since my data is imported and already verified.
Duplicate first and last names do legitmately exist in this application
and therefore I simply want to be notified when I access a record that
is such.
I've tried Dlookup and various other code, but it ends up flagging
every record or nothing at all...
Private Sub Form_Current()
On Error GoTo Err_cmdNoDup
If DCount("strLastName" & "strFirstName", "qryRecords") > 1 Then
MsgBox Me![strLastName] & ", " & Me![strFirstName] & " is a Name
Alert."
Else
End If
Exit_cmdNoDup
Exit Sub
Err_cmdNoDup:
MsgBox Err.Description
Resume Exit_cmdNoDup
End Sub