I have the following lines of code and I get an error on the DCount line saying "You canceled the previous operation"
I have tried different ways of writing the DCount statement, putting brackets around table and field names and other little changes with no success.
Also, it seems to me that the first argument is not necessary. I just want to count records in repairdata where rcvddate is before 30 days ago.
Does anybody know what is causing this mysterious error? Thanks.
Code:
Dim countRecords As Integer
countRecords = DCount("[RepairID]", "[RepairData]", "[rcvddate]< #" & Date - 30 & "#")
MsgBox countRecords
I have tried different ways of writing the DCount statement, putting brackets around table and field names and other little changes with no success.
Also, it seems to me that the first argument is not necessary. I just want to count records in repairdata where rcvddate is before 30 days ago.
Does anybody know what is causing this mysterious error? Thanks.