Hello all, i have been fighting with this for a bit and just thought that id reach out. Anyway my code is as follows;
Private Sub RCB_Number_BeforeUpdate(cancel As Integer)
Dim Answer As Variant
Answer = DLookup("[RCB_Number]", "tblRCB", "[RCB_Number] = '" & Me.RCB_Number & "'")
If Not IsNull(Answer) Then
MsgBox "RCB Number already exists please enter a new number", , "Duplicate Value"
cancel = True
Me.RCB_Number.Undo
Else:
End If
End Sub
My problem that im having is when i enable the Active content, it always "no matter what i put in the text box says there is duplicate data." Is there something that i missing in my code? And if i dont enable to content of course the VBA dont run. Any help with this would be great!
:banghead:
Private Sub RCB_Number_BeforeUpdate(cancel As Integer)
Dim Answer As Variant
Answer = DLookup("[RCB_Number]", "tblRCB", "[RCB_Number] = '" & Me.RCB_Number & "'")
If Not IsNull(Answer) Then
MsgBox "RCB Number already exists please enter a new number", , "Duplicate Value"
cancel = True
Me.RCB_Number.Undo
Else:
End If
End Sub
My problem that im having is when i enable the Active content, it always "no matter what i put in the text box says there is duplicate data." Is there something that i missing in my code? And if i dont enable to content of course the VBA dont run. Any help with this would be great!
:banghead: