Let me be more elaborate. I am trying to prevent duplicate entries on a combination of two fields, eg, HQ_File_Ref & HQ_File_Date. I am using the following code in the event before update in the field HQ_File_Date
Private Sub HQ_File_Date_BeforeUpdate(Cancel As Integer)
If DCount("[HQ_File_Ref]", "tblPropMain", "[HQ_File_Ref] =" & Me.[HQ_File_Ref] & " AND [HQ_File_Date] = " & Me.[HQ_File_Date]) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "HQ File reference no...." _
& HQREF & " has already been entered." _
& vbCr & vbCr & "Click OK to revert back....", vbInformation _
, "Duplicate Information"
End If
End Sub
This doesn’t work out. Please help
Thanks in anticipation
Regards
bijon