Results 1 to 2 of 2

Thread: block ADODC from moving

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Unhappy

    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

  2. #2
    Member
    Join Date
    Jun 2000
    Location
    Perth Western Australia
    Posts
    41

    Cool

    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
    ------------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width