Results 1 to 4 of 4

Thread: ADO MoveComplete vs. WillMove

  1. #1

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    Please Help!

    In my current project, I have determined that I am going to need the MoveComplete method(I think). It seems to be acting exactly like the WillMove method. Let me explain:
    Whenever I move to the "next" or "previous" record in a RecordSet, all the textboxes are updated properly, but the Tabs in the MS SSTab enabled property is always "one step behind".
    Code:

    Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    Tabs.TabEnabled(2) = False
    Tabs.TabEnabled(3) = False
    Tabs.TabEnabled(4) = False
    Tabs.TabEnabled(5) = False
    If txtType.Text = "Sheet" Then
    Tabs.TabEnabled(2) = True
    Tabs.TabEnabled(3) = True
    ElseIf txtType.Text = "Thermo" Then
    Tabs.TabEnabled(4) = True
    ElseIf txtType.Text = "Docutech" Then
    Tabs.TabEnabled(5) = True
    End If
    End Sub

    This example is the MoveComplete method. I have identical results if the code is placed in a WillMove method. Any help is greatly appreciated.
    Jim

    "...head is all empty and I don't care..."

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Wink

    the difference between those two events is that the code in
    the WillMove event is invoked before the recordset moves,
    and code in the MoveComplete event is invoked afterwards.

    I assume that txtType is connected to the Adodc control,
    like
    Code:
    txtType.DataSource = Adodc1
    txtType.DataField = "Field Name Here"
    You might try using the value of the recordset's field as a
    comparison rather that the text in txtType, e.g.
    Code:
    If Adodc1.Recordset.Fields("MyField").Value = "Sheet" Then
        Tabs.TabEnabled(2) = True 
        Tabs.TabEnabled(3) = True
    Theoretically it should not make any difference, but strange things happen in Windows and in ADO.

  3. #3

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    Hey Drew_Dog
    I thought the same thing until I tried your code and it worked!!!! Thank you so much, I can't tell you how much I appreciate it.
    JPRoy392
    Jim

    "...head is all empty and I don't care..."

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    ¡no hay problema! With Windows and VB, as with much of life, theory and reality are sometimes completely different... don't you just LOVE microsoft?

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