DigitalDan3
asked on
Accessing a series of Field names in a dataset sequentially using a for next loop.
I have the following code
If Not Convert.ToBoolean(dsMT.MT_ Work(X).SC 1_Ovr) Then
If Not dsMT.MT_Work(X).SCode1 = "" Or Not IsDBNull(dsMT.MT_Work(X).S Code1) Then
dsMT.MT_Work(X).SC1_Pay = Me.CalcSCode_Rate(dsMT.MT_ Work(X).SC ode1, dsMT.MT_Work(X).ComplDate)
Else
dsMT.MT_Work(X).SC1_Pay = 0
End If
End If
I have twelve of thes fields inwhich I need to perform the same operation
Instead of cutting/Pasting and editing I would like to be able to use a for next loop to specify the FieldName
For Y = 1 to 12
SCY_Ovr = "Blah Blah Blah"
Next
If Not Convert.ToBoolean(dsMT.MT_
If Not dsMT.MT_Work(X).SCode1 = "" Or Not IsDBNull(dsMT.MT_Work(X).S
dsMT.MT_Work(X).SC1_Pay = Me.CalcSCode_Rate(dsMT.MT_
Else
dsMT.MT_Work(X).SC1_Pay = 0
End If
End If
I have twelve of thes fields inwhich I need to perform the same operation
Instead of cutting/Pasting and editing I would like to be able to use a for next loop to specify the FieldName
For Y = 1 to 12
SCY_Ovr = "Blah Blah Blah"
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.