Thank you everyone for your help on this.
The answer turned out to be really simple. I created a query that counted each catch date and then referred back to the query instead of the the source table. It may not be the best way to do it but it works.
Private Sub...
Thanks again
The Code now looks like this
Private Sub CatchDate_BeforeUpdate(Cancel As Integer)
If DCount("CatchDate", "CatchDetails", "CatchDate=#" & Date & "#") > 0 And [CatchDate] = Date Then
Select Case MsgBox("Duplicate Date, Are You Sure?", vbYesNo)
Case vbYes
Case vbNo
End Select
End If...
No not exactly the only way I can get it to work is for the warning to come up each time the date is entered even if it's not a duplicate date. DCount value >0 doesn't work only >= to?
Thanks burrina
I tried the code but the prompt only appears if I make the count >= 0
I thought it might have been because I'm using the form in data entry format but it didn't make any difference when I changed it. I'm also using a single form not a datasheet, could this be the problem?
I have a data entry form linked to a table that records daily catch details (date, invoice number, buyer, kilos, price, etc). For the last 2 years I've been using the no duplicate index on the date field of the table to prevent duplicates, until he (my husband) decided that he wanted to sell...