Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with DCount "You canceled the previous operation"

Status
Not open for further replies.

bmc1234

Programmer
Jul 21, 2005
50
US
I have the following lines of code and I get an error on the DCount line saying "You canceled the previous operation"

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.
 
OK, I fixed the problem. It was statusid instead of status.
 
I just want to count records
countRecords = DCount("*", ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top