PDA

Click to See Complete Forum and Search --> : block ADODC from moving


DrewDog_21
Jul 12th, 2000, 05:56 PM
I want to be able to block the recordset on an ADO control from moving when a boolean value is false (e.g. canMove = False). What event would I put this under, and how would the code look? I have tried several things and can't get it to work at all times.

Thanks

Andrew

CGTS
Jul 12th, 2000, 08:16 PM
If you are using an ADODC data control you can use the WillMove event to capture the pending move and test your condition, setting adStatus to adStatusCancel if false.

You can of course use this same technique for ADO code or a DataEnvironment recordset, although you may have to deal with some errors for these two methods.

------------------------------------------------------------
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If canMove = False Then
adStatus = adStatusCancel
End If
End Sub
------------------------------------------------------------