My DCount function isn't working.....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 
Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside
 
I think IsNull needs to be changed:
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct] Is
Null")
or
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND
IsNull([LoadAct])")
--
Duane Hookom
Microsoft Access MVP


Ofer Cohen said:
Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside

--
Good Luck
BS"D


J. Keggerlord said:
=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 
Thank you, Duane and Ofer! Your suggestions did the trick!


Duane Hookom said:
I think IsNull needs to be changed:
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct] Is
Null")
or
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND
IsNull([LoadAct])")
--
Duane Hookom
Microsoft Access MVP


Ofer Cohen said:
Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside

--
Good Luck
BS"D


J. Keggerlord said:
=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 
Back
Top