-
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.
-
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.
-
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
-
¡no hay problema! With Windows and VB, as with much of life, theory and reality are sometimes completely different... :rolleyes: don't you just LOVE microsoft?