Hi every Boady;
i have problem with dcount prevent duplicate ?
first field book_no (table ) maintable
id,book_no with number ,date_series short date
i want to prevent duplicate book_no with the same date/time
Private Sub Text74_BeforeUpdate(Cancel As Integer)
If DCount("*", "maintable", "[book_no]= " & Me.[book_no] & " and [date_series]= #" & Me.[date_series] & "#") > 0 Then
MsgBox " it is duplicate ", vbExclamation
Me.Undo
Cancel = True
End If
End Sub
i have problem with dcount prevent duplicate ?
first field book_no (table ) maintable
id,book_no with number ,date_series short date
i want to prevent duplicate book_no with the same date/time
Private Sub Text74_BeforeUpdate(Cancel As Integer)
If DCount("*", "maintable", "[book_no]= " & Me.[book_no] & " and [date_series]= #" & Me.[date_series] & "#") > 0 Then
MsgBox " it is duplicate ", vbExclamation
Me.Undo
Cancel = True
End If
End Sub