適用先: Access 2013、Office 2013
The Before Delete event occurs when a record is deleted, but before the change is committed.
注:
Before Delete イベントは、データ マクロでのみ使用できます。
注釈
Use the Before Delete event to perform any actions that you want to occur before a record is deleted. The Before Change is commonly used to perform validation and to raise custom error messages.
削除するレコード内の値にアクセスするには、次の構文を使用します。
[Old].[Field Name]
たとえば、削除するレコードの QuantityInStock フィールドの値にアクセスするには、次の構文を使用します。
[Old].[QuantityInStock]
The values contained in the record to be deleted are deleted permanently when the Before Delete event ends.
You can cancel the Before Delete event by using the RaiseError action. エラーが発生すると、 削除前 イベントに含まれる変更が破棄されます。
The following table lists macro commands that can be used in the Before Delete event.
コマンドの種類 |
コマンド |
|---|---|
プログラム フロー |
|
プログラム フロー |
|
プログラム フロー |
|
データ ブロック |
|
データ アクション |
|
データ アクション |
|
データ アクション |
|
データ アクション |
|
データ アクション |
To create a Data macro that captures the Before Delete event, use the following steps.
Open the table for which you want to capture the Before Delete event.
[ テーブル ] タブの [ イベントの前 ] グループで、[ 削除前] を選択します。