Dim section As Processing.DetailSection = DirectCast(sender, Processing.DetailSection) Dim dobj As Processing.IDataObject = DirectCast(section.DataObject, Processing.IDataObject) Dim txtbxComment = DirectCast(section.ChildElements.Find("txtComment", True)(0), Processing.TextBox) Dim txtbxOTRelief = DirectCast(section.ChildElements.Find("txtOTRelief", True)(0), Processing.TextBox) Dim txtbxOTTrain = DirectCast(section.ChildElements.Find("txtOTTrain", True)(0), Processing.TextBox) Dim txtbxOTSched = DirectCast(section.ChildElements.Find("txtOTSched", True)(0), Processing.TextBox) Dim txtbxOTOther = DirectCast(section.ChildElements.Find("txtOTOther", True)(0), Processing.TextBox) Dim txtbxVacAvail = DirectCast(section.ChildElements.Find("txtVacAvail", True)(0), Processing.TextBox) Dim txtbxVacUsed = DirectCast(section.ChildElements.Find("txtVacUsed", True)(0), Processing.TextBox) Dim txtbxVacRemain = DirectCast(section.ChildElements.Find("txtVacRemain", True)(0), Processing.TextBox) Dim txtbxPCHAvail = DirectCast(section.ChildElements.Find("txtPCHAvail", True)(0), Processing.TextBox) Dim txtbxPCHUsed = DirectCast(section.ChildElements.Find("txtPCHUsed", True)(0), Processing.TextBox) Dim txtbxPCHRemain = DirectCast(section.ChildElements.Find("txtPCHRemain", True)(0), Processing.TextBox) Dim txtbxPPNbr = DirectCast(section.ChildElements.Find("txtPPNbr", True)(0), Processing.TextBox) Dim txtbxOT = DirectCast(section.ChildElements.Find("txtOT", True)(0), Processing.TextBox) Dim txtbxWorkDate = DirectCast(section.ChildElements.Find("txtWorkDate", True)(0), Processing.TextBox) txtbxPPNbr.Value = Get_PayPeriod(dobj("TTD_WORK_DATE")) If txtbxOT.Value > 0 Then If InStr(1, txtbxComment.Value, "Relief") > 0 Then txtbxOTRelief.Value = txtbxOT.Value sglOTRelief += txtbxOT.Value ElseIf InStr(1, txtbxComment.Value, "Train") > 0 Then txtbxOTTrain.Value = txtbxOT.Value sglOTTrain += txtbxOT.Value ElseIf InStr(1, txtbxComment.Value, "Sched") > 0 Then txtbxOTSched.Value = txtbxOT.Value sglOTSched += txtbxOT.Value Else txtOTOther.Value = txtbxOT.Value sglOTOther = txtbxOT.Value End If End IfPublic Shared Function Get_PayPeriod(ByVal dtWorkDate As Date) As Integer Dim intX As Integer = 0 Dim avarPayPeriods() As TCCPayPeriods = aPayPeriods For intX = 0 To UBound(avarPayPeriods) If dtWorkDate >= avarPayPeriods(intX).dtPayPeriod And intX = 23 Then Return avarPayPeriods(intX).bytPayPeriodNbr Exit For ElseIf dtWorkDate >= avarPayPeriods(intX).dtPayPeriod And dtWorkDate < avarPayPeriods(intX + 1).dtPayPeriod Then Return avarPayPeriods(intX).bytPayPeriodNbr Exit For End If Next intX End FunctionI received this error when trying to process a detail section of a report. I am referencing the fields as follows:
Assume TCCPayPeriods structure defined correctly. Any ideas what I am doing wrong. Thanks in advance.