Access 2010
With the help of pbaldy, my code is now validating for duplicate entries.
My problem is now with the rest of the code:
I get the error message: -2147352567 which states:
My question is this: is this an error that I can trap without any issues down the road?
Thanks!
With the help of pbaldy, my code is now validating for duplicate entries.
My problem is now with the rest of the code:
Code:
Private Sub RankOrder_BeforeUpdate(Cancel As Integer)
Dim lngRankDup As Long
lngRankDup = Nz(DLookup("[RankOrder]", "tblTestEvents", "[RankOrder]=" & RankOrder), 0)
If lngRankDup <> 0 Then
MsgBox "The Rank of " & [RankOrder] & " already exists in the database!" & vbCrLf & vbCrLf & "Please enter the number again!", vbInformation, "Rank Already Exists"
Me.RankOrder = ""
Me.RankOrder.SetFocus
End If
End Sub
I get the error message: -2147352567 which states:
The macro of function set to the Beforeupdate property for this field is preventing MS Access from saving the data in the field
My question is this: is this an error that I can trap without any issues down the road?
Thanks!