使用 ActiveDataAccessPage 屬性可以識別或引用具有焦點(diǎn)的數(shù)據(jù)訪問頁。DataAccessPage 對象,只讀。
expression.ActiveDataAccessPage
expression 必需。返回“應(yīng)用于”列表中的一個對象的表達(dá)式。
ActiveDataAccessPage 屬性設(shè)置包含一個對運(yùn)行時具有焦點(diǎn)的 DataAccessPage 對象的引用。
此屬性僅在使用宏或 Visual Basic 時才可用,并且具有只讀屬性。
ActiveDataAccessPage 屬性用于引用活動的數(shù)據(jù)訪問頁連同其中一個屬性或方法。以下示例顯示活動數(shù)據(jù)訪問頁的 Name 屬性設(shè)置:
Dim pgCurrentPage As DataAccessPage
Set pgCurrentPage = Screen.ActiveDataAccessPage
MsgBox "Current Data Page is " & pgCurrentPage.Name
在使用 ActiveDataAccessPage 屬性時,如果數(shù)據(jù)訪問頁不具有焦點(diǎn),將會發(fā)生錯誤。