Reports 集合

expandtri全部显示

Application

parchildReports

spaceparchildReport

spacespaceparchild多个对象

Reports 集合包含 Microsoft Access 数据库中所有当前打开的报表

使用 Reports 集合

在 Visual Basic 或表达式中使用 Reports 集合,可以引用当前打开的报表。例如,可以通过列举 Reports 集合来设置或返回该集合中单个报表的属性值。

blueup提示

For Each...Next

可以引用 Reports 集合中的单个 Report 对象,方法是:按照名称引用报表,或引用集合中报表的索引。

Reports 集合的索引从零开始。如果按照索引引用报表,则第一个打开的报表是 Reports(0),第二个打开的是 Reports(1),依此类推。如果打开 Reports1,然后打开 Report2,则 Report2 在 Reports 集合中的索引为 Reports(1)。如果关闭 Report1,Report2 在 Reports 集合的索引将变为 Reports(0)。

注释   若要列举出数据库中的所有报表(不论是打开的还是关闭的),只需列举出报表 CurrentProject 对象的 Allreports 集合即可。然后,可使用每个 AccessObject 对象的 Name 属性返回报表的名称。

无法在 Reports 集合中添加或删除 Report 对象。