[英]Access how to show record count of a table on a form
I want to show a variable value (record count of a table) on an Access form. 我想在Access窗体上显示一个变量值(表的记录数)。 I tried with a textbox by defining its control source with the following and many other internal functions but all returned only errors.
我尝试通过使用以下以及许多其他内部函数定义文本框的控制源来尝试使用文本框,但所有文本框仅返回错误。 Anyone can help?
有人可以帮忙吗? Thanks
谢谢
select count(*) from TableName
You need =
and domain functions. 您需要
=
和域函数。
=DCount("*", "TableName")
should work as control source. 应该作为控制源。
I would also suggest the DCount
domain aggregate function as suggested by Andre, but to offer an alternative, if TableName
is the Record Source for your form, you can also use: 我还建议使用Andre建议的
DCount
域聚合函数,但是要提供另一种选择,如果TableName
是表单的记录源,则还可以使用:
=Count(*)
To count all records in the Record Source, or: 要计算记录源中的所有记录,或:
=Count([FieldName])
To count all non-null values of a particular field in the Record Source. 计算记录源中特定字段的所有非空值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.