I'm getting this error for the last line of this code:
Code:
Dim ComKey
Dim ComCode, SubComCode
Dim SelectedCompanys
ComCode = rpt.Sections("Detail").Controls("COM_CompanyCode12").DataValue
SubComCode = rpt.Sections("Detail").Controls("SUBCOM_SubsidiaryCode12").DataValue
ComKey = ComCode & "_"
If SubComCode <> "" Then
ComKey = ComKey & SubComCode & "_"
End If
' Totals were not being accumulated correctly by default, so must keep track of them manually
vars.StrVar(ComKey & "_GROUPTOT") = vars.StrVar(ComKey & "_GROUPTOT") + rpt.Sections("Detail").Controls("GLFormula1").DataValue
Comment