Give me a message for duplicate record

Ukraine82

Registered User.
Local time
Today, 09:39
Joined
Jun 14, 2004
Messages
346
I'm having hard trouble making a message box for duplicate record. I made a form as my message box with 2 command buttons for GoTo and Clear. My message box form has 3 fields that will tell the user what is duplicate.

Is there a vb code that will tell me there is a duplicate record and what they are from the 3 fields I made in a message box form?

Let say I don't want Policy field to be duplicate.

Thanks,

Michael
 
Just Paste This Code on Error Event

Just Paste this code on error event


If DataErr > 0 Then
If IsNull(Me.Parent!CustomerID) Then
MsgBox "Select a Customer to bill to before entering order details info."
RunCommand acCmdUndo
Me.Parent!CustomerID.SetFocus
Response = acDataErrContinue
ElseIf DataErr = 3314 Then
MsgBox "Blank Fields Are Not Allowed", vbCritical, "Aslamo-Alikum From Kashif"

SendKeys "{ESC}"
SendKeys "{ESC}"


Else
Response = acDataErrDisplay
If DataErr = 3022 Then
MsgBox "Check this is the Duplicate Product", vbInformation, "Duplicate Value"

SendKeys "{ESC}"

SendKeys "{ESC}"
Else
Response = acDataErrDisplay
If DataErr = 3162 Then
MsgBox ("This is the duplicate")
SendKeys "{ESC}"

SendKeys "{ESC}"
Else
Response = acDataErrDisplay




End If

End If

End If
End If


End Sub
 
Just Paste This Code on Error Event

If DataErr = 3022 Then
MsgBox "Check this is the Duplicate Product", vbInformation, "Duplicate Value"

SendKeys "{ESC}"

SendKeys "{ESC}"
Else
Response = acDataErrDisplay
End if
 

Users who are viewing this thread

Back
Top Bottom