MS Access中的Dcount未正确过滤

时间:2015-10-05 14:46:40

标签: ms-access dcount

我正在通过文本框在表单中执行dcount。我只需要在表格中添加原因类型和clientid从开放表单中过滤的原因。表单已打开,dcount计算所有类型字母的记录,但不会被客户端过滤。

有什么建议吗?

 =DCount("reason","dbo_TimerTable","reason = letter" And "ClientID = Forms![Clients]![ClientID]")

1 个答案:

答案 0 :(得分:3)

参数必须在字符串之外,并且标准必须是一个表达式。

=DCount("reason","dbo_TimerTable","reason = letter And ClientID = " & Forms![Clients]![ClientID])

虽然我认为原因是文本字段,但您需要:

=DCount("reason","dbo_TimerTable","reason = 'letter' And ClientID = " & Forms![Clients]![ClientID])

但你说原因过滤已经有效了......