Reports 集合

此頁沒有內(nèi)容條目
內(nèi)容

expandtri全部顯示

Application

parchildReports

spaceparchildReport

spacespaceparchild多個對象

Reports 集合包含 Microsoft Access 數(shù)據(jù)庫中所有當前打開的報表。

使用 Reports 集合

在 Visual Basic 或表達式中使用 Reports 集合,可以引用當前打開的報表。例如,可以通過列舉 Reports 集合來設(shè)置或返回該集合中單個報表的屬性值。

blueup提示

For Each...Next

可以引用 Reports 集合中的單個 Report 對象,方法是:按照名稱引用報表,或引用集合中報表的索引。

Reports 集合的索引從零開始。如果按照索引引用報表,則第一個打開的報表是 Reports(0),第二個打開的是 Reports(1),依此類推。如果打開 Reports1,然后打開 Report2,則 Report2 在 Reports 集合中的索引為 Reports(1)。如果關(guān)閉 Report1,Report2 在 Reports 集合的索引將變?yōu)?Reports(0)。

注釋   若要列舉出數(shù)據(jù)庫中的所有報表(不論是打開的還是關(guān)閉的),只需列舉出報表 CurrentProject 對象的 Allreports 集合即可。然后,可使用每個 AccessObject 對象的 Name 屬性返回報表的名稱。

無法在 Reports 集合中添加或刪除 Report 對象。