分享方式:


Form.CurrentSectionTop 屬性 (存取)

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

語法

表達。當前部分頂部

expression 代表 Form 物件的變數。

註解

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

對於 DefaultView 屬性設定為 Single Form 的表單,如果使用者捲動到區段的左上角上方,則屬性設定為負值。

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

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

範例

下列範例會顯示連續表單上控制項的 CurrentSectionLeftCurrentSectionTop 屬性設定。 無論使用者何時移動至新的記錄,目前區段的屬性設定值會顯示在表單頁首的 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 支援與意見反應