|
-
Sep 7th, 2000, 07:28 AM
#1
Thread Starter
Member
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..."
-
Sep 7th, 2000, 08:59 AM
#2
Hyperactive Member
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.
-
Sep 7th, 2000, 09:22 AM
#3
Thread Starter
Member
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..."
-
Sep 7th, 2000, 10:27 AM
#4
Hyperactive Member
¡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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|