I use this expression to prevent duplication on my data (GuestID is unique).it was successfuly creating my own message. The problem is it comes up another message
" The value in the field or records violates the validation rules for the records or field"
Is that "Variant" affect to my GuestID value ?
thank you for your attention
Private Sub GuestID_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
If DCount("[GuestID]", "Guest Application record", "[GuestID]= " & Me![GuestID]) = 1 Then
Answer = MsgBox("Guest ID sudah ada, Coba Yg Lain", vbOKOnly, "Hey You!")
If Answer = vbOK Then Cancel = True
End If
End Sub
" The value in the field or records violates the validation rules for the records or field"
Is that "Variant" affect to my GuestID value ?
thank you for your attention
Private Sub GuestID_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
If DCount("[GuestID]", "Guest Application record", "[GuestID]= " & Me![GuestID]) = 1 Then
Answer = MsgBox("Guest ID sudah ada, Coba Yg Lain", vbOKOnly, "Hey You!")
If Answer = vbOK Then Cancel = True
End If
End Sub