Good, then it seems as if you need to use the test with the correct field
name and hopefully you will get the results you are looking for.
IF DCOUNT("[Monthly Date]","tblmonthly","[Monthly Date] Between Date()-30
and Date()") = 0 THEN
MsgBox "Test overdue,please schedule asap", vbCritical, "Monthly
Checks"
End If
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
steve said:
John,
Amended the code and the following results wre produced
?DCOUNT("*","tblmonthly","[Monthly Date] < Date()-30")
1
?DCOUNT("*","tblmonthly","[Monthly Date] Between Date()-30 and Date()")
1
?DCount("[Monthly Date]","tblmonthly")
2
?DCount("*","tblmonthly")
2
There are only 2 records in my db - dates are:
25 June 09 & 27 July 09
Steve
John W. Vinson said:
On Mon, 3 Aug 2009 22:24:30 +0100, "steve goodrich"
Run time error 64479, can't find the name Monthly_date you entered in
your
expression
Does your table contain a field named Monthly_date (with the
underscore)?
If it contains a field named "Monthly date", replace Monthly_date with
[Monthly date] including the square brackets.