View Full Version : DCount Function in Macro Condition


KP_SoCal
03-30-2010, 10:19 AM
The expression below fires an action when "There are more than 35 entries in the OrderID field of the Orders table."
DCount("[OrderID]", "Orders")>35

I'm looking for a condition that would fire when "There are more than 35 entries in OrderID field that are NUll for the Orders table."

Any suggestions would be greatly appreciated! Thanks!

pbaldy
03-30-2010, 10:25 AM
Try

DCount("[OrderID]", "Orders", "OrderID Is Null")>35

KP_SoCal
03-30-2010, 11:44 AM
Wierd, I tried is both ways and am unable to make it work. If the OrderID has a value, if I specify it in my criteria (eg: "OrderID = '501'"), it works. But it's not working for "OrderID Is Null" or "IsNull("OrderID). Any ideas???


DCount("[OrderID]","tblNeedsLTS",IsNull("OrderID"))>35

KP_SoCal
03-30-2010, 12:12 PM
As a workaround, I set the default value of the field to be ' ', and it worked.

DCount("[OrderID]","Orders,"OrderID = ' '")>0

:cool: