hardhitter06
Registered User.
- Local time
- Today, 05:51
- Joined
- Dec 21, 2006
- Messages
- 600
Hi All (Access 2003),
I created a simple input form (frmVendorInput) with the fields 'VendorName' and 'VendorFedID'.
I set up custom code to alert the user when they have entered a duplicate Fed ID:
After this alert, Access displays its own validation message that I'd like to remove:
"The value in the field or record violates the validation rule for the record or field. For example you may have changed a validation rule without verfying whether the existing data matches the new validation rule."
Can someone let me know how I would remove this message. I will attach my DB and test with Fed ID "123456789" since that is already in the system.
Thank you,
Josh
I created a simple input form (frmVendorInput) with the fields 'VendorName' and 'VendorFedID'.
I set up custom code to alert the user when they have entered a duplicate Fed ID:
Code:
Private Sub VendorFedID_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
Answer = DLookup("[VendorFedID]", "tblInputNewVendor", "[VendorFedID] = '" & Me.VendorFedID & "'")
If Not IsNull(Answer) Then
MsgBox "Duplicate Federal ID Number Found" & vbCrLf & "Please enter again.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
Cancel = True
Me.VendorFedID.Undo
Else:
End If
End Sub
After this alert, Access displays its own validation message that I'd like to remove:
"The value in the field or record violates the validation rule for the record or field. For example you may have changed a validation rule without verfying whether the existing data matches the new validation rule."
Can someone let me know how I would remove this message. I will attach my DB and test with Fed ID "123456789" since that is already in the system.
Thank you,
Josh