Dcount

  • Thread starter Thread starter Mike Darrington
  • Start date Start date
M

Mike Darrington

I am trying to get a dcount function to work and I can not seem to get it to
work

Cards = DCount("[Look]", "Daily_Check", "Y")

the table name is Daily_Check, and the Field in the table is named Look.

Any help would be apperciated. Thanks
 
Mike said:
I am trying to get a dcount function to work and I can not seem to
get it to work

Cards = DCount("[Look]", "Daily_Check", "Y")

the table name is Daily_Check, and the Field in the table is named
Look.

Any help would be apperciated. Thanks

The third WHERE argument must be a fully functional WHEREclause such that
you would find in a SQL statement minus the actual word "where". Your third
argument "Y" is meaningless.
 
I am trying to get a dcount function to work and I can not seem to get it to
work

Cards = DCount("[Look]", "Daily_Check", "Y")

the table name is Daily_Check, and the Field in the table is named Look.

Any help would be apperciated. Thanks
I'll guess you wish to count how many records are in the table where
the field named [Look] = "Y".

Cards = DCount("*","Daily_Check","[Look] = 'Y'")

The criteria field must be a full Where clause string value, and if
the criteria field is a Text datatype, the criteria value itself must
be enclosed within quotes. But because we're already enclosing the
entire clause within double quotes, the value is enclosed in single
quotes.

Look up Where clause in VBA help, as well as
Restrict data to a subset of records
for more information and how to write the clause for various
datatypes.
 
Back
Top