アドレス帳の移動ボタン
適用先: Access 2013、Office 2013
アドレス帳アプリケーションは、Web ページの下部にナビゲーション ボタンを表示します。 ナビゲーション ボタンを使ってデータの最初または最後の行、あるいは現在の行の前後にある行を選択することにより、HTML のグリッド表示内でデータ間を移動できます。
ナビゲーションのサブ プロシージャ
The Address Book application contains several procedures that allow users to click the First, Next, Previous, and Last buttons to move around the data.
For example, clicking the First button activates the VBScript First_OnClick Sub procedure. The procedure executes a MoveFirst method, which makes the first row of data the current selection. Clicking the Last button activates the Last_OnClick Sub procedure, which invokes the MoveLast method, making the last row of data the current selection. The remaining navigation buttons work in a similar fashion.
' Move to the first record in the bound Recordset.
Sub First_OnClick
DC1.Recordset.MoveFirst
End Sub
' Move to the next record from the current position
' in the bound Recordset.
Sub Next_OnClick
If Not DC1.Recordset.EOF Then ' Cannot move beyond bottom record.
DC1.Recordset.MoveNext
Exit Sub
End If
End Sub
' Move to the previous record from the current position in the bound
' Recordset.
Sub Prev_OnClick
If Not DC1.Recordset.BOF Then ' Cannot move beyond top record.
DC1.Recordset.MovePrevious
Exit Sub
End If
End Sub
' Move to the last record in the bound Recordset.
Sub Last_OnClick
DC1.Recordset.MoveLast
End Sub