Link to home
Start Free TrialLog in
Avatar of DigitalDan3
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).SC1_Ovr) Then
                If Not dsMT.MT_Work(X).SCode1 = "" Or Not IsDBNull(dsMT.MT_Work(X).SCode1) Then
                    dsMT.MT_Work(X).SC1_Pay = Me.CalcSCode_Rate(dsMT.MT_Work(X).SCode1, 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
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial