GoToRecord マクロ アクション
適用先: Access 2013、Office 2013
"GoToRecord/レコードの移動" アクションを使用すると、開いているテーブル、フォーム、またはクエリの結果セットで、指定したレコードをカレント レコードにすることができます。
設定
"GoToRecord/レコードの移動" アクションの引数は次のとおりです。
アクションの引数 |
説明 |
---|---|
オブジェクトの種類 |
カレント レコードにするレコードが含まれているオブジェクトの種類を指定します。 [マクロ ビルダー] ウィンドウの [アクションの引数] セクションにある [オブジェクトの種類] ボックスで、[テーブル]、[クエリ]、[フォーム]、[サーバー ビュー]、[ストアド プロシージャ]、[関数] のいずれかをクリックします。 この引数を指定しない場合は、アクティブ オブジェクトが選択されます。 |
オブジェクト名 |
カレント レコードにするレコードが含まれているオブジェクトの名前を指定します。 [オブジェクト名] ボックスには、カレント データベースに含まれる、"Object Type/オブジェクトの種類" 引数で指定した種類のオブジェクトがすべて表示されます。 "Object Type/オブジェクトの種類" 引数を指定しない場合は、この引数も指定しないでください。 |
Record |
カレント レコードにするレコードを指定します。 [レコード] ボックスで、[前のレコード]、[次のレコード]、[先頭のレコード]、[最後のレコード]、[移動先指定]、[新しいレコード] のいずれかをクリックします。 既定値は [次のレコード] です。 |
Offset |
整数値、または結果が整数値となる式を指定します。 式の前に等号 (=) を付ける必要があります。 この引数では、カレント レコードにするレコードを指定します。 この引数の使用方法は 2 とおりあります。
|
注釈
レコードの特定のコントロールにフォーカスがある場合、このアクションを実行しても、新しいフォームの同じコントロールにフォーカスがとどまります。
You can use the New setting for the Record argument to move to the blank record at the end of a form or table so you can enter new data.
This action is similar to clicking the arrow below the Find button on the Home tab and then clicking Go To. The First, Last, Next, Previous, and New Record subcommands of the Go To command have the same effect on the selected object as the First, Last, Next, Previous, and New settings for the Record argument. You can also move to records by using the navigation buttons at the bottom of the window.
You can use the GoToRecord action to make a record on a hidden form the current record if you specify the hidden form in the Object Type and Object Name arguments.
To run the GoToRecord action in a Visual Basic for Applications (VBA) module, use the GoToRecord method of the DoCmd object.