DCount syntax

J

JethroUK©

i'm trying to count how many records ([ID]'s) in the table (Clients) have
the same [Start Date] as the one on the form - but i get a #Name error ?

=DCount("[id]","clients","[start date]= " & [me].[Start_Date])

also tried

=DCount("[id]","clients","clients![start date]= '" & [me].[Start_Date] "'")
 
K

Ken Snell [MVP]

Is this an expression for a control source of a textbox? If yes, drop the
"me" reference.

Also, you need to delimit the date value with # characters:

=DCount("[id]","clients","[start date]= #" & [Start_Date] & "#")
 
J

JethroUK©

i never thought about the # signs - thanks very much


Ken Snell said:
Is this an expression for a control source of a textbox? If yes, drop the
"me" reference.

Also, you need to delimit the date value with # characters:

=DCount("[id]","clients","[start date]= #" & [Start_Date] & "#")

--

Ken Snell
<MS ACCESS MVP>

JethroUK© said:
i'm trying to count how many records ([ID]'s) in the table (Clients) have
the same [Start Date] as the one on the form - but i get a #Name error ?

=DCount("[id]","clients","[start date]= " & [me].[Start_Date])

also tried

=DCount("[id]","clients","clients![start date]= '" & [me].[Start_Date]
"'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top