简体   繁体   English

访问如何在表单上显示表的记录计数

[英]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.

相关问题 如何将记录从访问表单插入另一个访问表 - How to insert record from an access form to another access table 使用过滤器在单个表格上显示总记录数 - Show total record count on single form with filter ACCESS VBA:可以在多表形式的 1 个表中添加记录吗? - ACCESS VBA: Add record in 1 table on a multi-table form possible? 在访问中需要双击子表单中的记录以显示主表单的详细信息 - in access need to doubleclick on record in subform to show detail on main form 如何根据访问表单中另一个选项卡的主键在表中创建新记录? - How do I create a new record in a table according to primary key of another tab in an Access Form? 如何选择表单中的记录并显示基于该记录的计算? - How do you select a record in a form and show calculations based on that record? MS Access筛选器子表通过记录选择在窗体上 - MS Access Filter Child Table by Record Chose on Form 访问表格进入记录 - Access Form Go To Record 如何将当前记录从一个表单移动到Access中的另一个表单? - How to move current record from a form to another form in access? 如果不保存记录,如何在表单上显示用户电子邮件的错误消息 - How to show error messages for a user's email on a form if not saving record
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM