Unanswered: Duplicate entry message-edit/show/add new
I have created a db and using only one form for dataentry. I have given the code below which pops a message if a duplicate entry is made. Can you help me what code to use if i want access to do following: - If the entry is duplicate as of now it just shows that the entry exists. I want the database to:
Give me option such as Do you want to view exisiting entry / add a new entry / edit exisiting entry.
The code i used is:
Private Sub Ctl_Lname_BeforeUpdate(Cancel As Integer)
Dim dupCount As Long
dupCount = DCount("*", "Marketing", "[LName]= '" & Me.[LName] & "'" & " And " & "[FName] = '" & Me.[FName] & "'")
If dupCount <> 0 Then
MsgBox "This name already exists in the database. Please check that you are not entering a duplicate person before continuing.", vbOKOnly, "Duplicate Value"
Cancel = True