Form.CurrentSectionTop 屬性 (Access)

使用此屬性可以判斷從目前區段頂端邊緣到表單頂端邊緣的距離,單位為 twip。 可讀寫的 Integer。

語法

運算式。CurrentSectionTop

expression 代表 Form 物件的變數。

註解

當使用者捲動表單時,CurrentSectionTop 屬性值會改變。

對於 DefaultView 屬性設定為 [單一表單] 的表單,如果使用者捲動到區段左上角以上,屬性設定為負值。

對於 DefaultView 屬性設定為 Continuous Forms 的表單,如果看不到區段,則 CurrentSectionTop 屬性等於表單的 InsideHeight 屬性。

CurrentSectionTop 屬性很適於用來尋找顯示在表單檢視中做為連續表單的詳細資料區段或資料工作表檢視的詳細資料區段之位置。 每一詳細資料區段有不同的 CurrentSectionTop 屬性設定值,端視表單中區段的位置而定。

範例

下列範例會顯示連續表單上控制項的 CurrentSectionLeft 和 CurrentSectionTop 屬性設定。 無論使用者何時移動至新的記錄,目前區段的屬性設定值會顯示在表單頁首的 lblStatus 標籤中。

Private Sub Form_Current() 
 
 Dim intCurTop As Integer 
 Dim intCurLeft As Integer 
 
 intCurTop = Me.CurrentSectionTop 
 intCurLeft = Me.CurrentSectionLeft 
 Me!lblStatus.Caption = intCurLeft & " , " & intCurTop 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。