--- title: "WillMove and MoveComplete Events (ADO) | Microsoft Docs" ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.custom: "" ms.date: "01/19/2017" ms.reviewer: "" ms.topic: conceptual apitype: "COM" f1_keywords: - "Recordset::MoveComplete" - "WillMove" - "MoveComplete" - "Recordset::WillMove" helpviewer_keywords: - "MoveComplete event [ADO]" - "WillMove event [ADO]" ms.assetid: 1a3d1042-4f30-4526-a0c7-853c242496db author: MightyPen ms.author: genemi --- # WillMove and MoveComplete Events (ADO) The **WillMove** event is called before a pending operation changes the current position in the [Recordset](../../../ado/reference/ado-api/recordset-object-ado.md). The **MoveComplete** event is called after the current position in the **Recordset** changes. ## Syntax ``` WillMove adReason, adStatus, pRecordset MoveComplete adReason, pError, adStatus, pRecordset ``` #### Parameters *adReason* An [EventReasonEnum](../../../ado/reference/ado-api/eventreasonenum.md) value that specifies the reason for this event. Its value can be **adRsnMoveFirst**, **adRsnMoveLast**, **adRsnMoveNext**, **adRsnMovePrevious**, **adRsnMove**, or **adRsnRequery**. *pError* An [Error](../../../ado/reference/ado-api/error-object.md) object. It describes the error that occurred if the value of *adStatus* is **adStatusErrorsOccurred**; otherwise the parameter is not set. *adStatus* An [EventStatusEnum](../../../ado/reference/ado-api/eventstatusenum.md) status value. When **WillMove** is called, this parameter is set to **adStatusOK** if the operation that caused the event was successful. It is set to **adStatusCantDeny** if this event cannot request cancellation of the pending operation. When **MoveComplete** is called, this parameter is set to **adStatusOK** if the operation that caused the event was successful, or to **adStatusErrorsOccurred** if the operation failed. Before **WillMove** returns, set this parameter to **adStatusCancel** to request cancellation of the pending operation, or set this parameter to **adStatusUnwantedEvent** to prevent subsequent notifications. Before **MoveComplete** returns, set this parameter to **adStatusUnwantedEvent** to prevent subsequent notifications. *pRecordset* A [Recordset](../../../ado/reference/ado-api/recordset-object-ado.md) object. The **Recordset** for which this event occurred. ## Remarks A **WillMove** or **MoveComplete** event may occur due to the following **Recordset** operations: [Open](../../../ado/reference/ado-api/open-method-ado-recordset.md), [Move](../../../ado/reference/ado-api/move-method-ado.md), [MoveFirst](../../../ado/reference/ado-api/movefirst-movelast-movenext-and-moveprevious-methods-ado.md), [MoveLast](../../../ado/reference/ado-api/movefirst-movelast-movenext-and-moveprevious-methods-ado.md), [MoveNext](../../../ado/reference/ado-api/movefirst-movelast-movenext-and-moveprevious-methods-ado.md), [MovePrevious](../../../ado/reference/ado-api/movefirst-movelast-movenext-and-moveprevious-methods-ado.md), [AddNew](../../../ado/reference/ado-api/addnew-method-ado.md), and [Requery](../../../ado/reference/ado-api/requery-method.md). These events may occur because of the following properties: [Filter](../../../ado/reference/ado-api/filter-property.md), [Index](../../../ado/reference/ado-api/index-property.md), [Bookmark](../../../ado/reference/ado-api/bookmark-property-ado.md), [AbsolutePage](../../../ado/reference/ado-api/absolutepage-property-ado.md), and [AbsolutePosition](../../../ado/reference/ado-api/absoluteposition-property-ado.md). These events also occur if a child **Recordset** has **Recordset** events connected and the parent **Recordset** is moved. You must set the *adStatus* parameter to **adStatusUnwantedEvent** for each possible *adReason* value in order to completely stop event notification for any event that includes an *adReason* parameter. ## See Also [ADO Events Model Example (VC++)](../../../ado/reference/ado-api/ado-events-model-example-vc.md) [ADO Event Handler Summary](../../../ado/guide/data/ado-event-handler-summary.md) [Recordset Object (ADO)](../../../ado/reference/ado-api/recordset-object-ado.md)