I am needing to come up with a percentage calculation. My report pulls the data from one main report and has three nested subreports. The final value will differ, based on one of the variables (referred to as 'Team', but boils down to location) which can be found in one of the subreports.
The basic expression is: DCA/SiteDCA
Seems simple, but the value of SiteDCA is dependant on the value of "Team", such as the Select Case statement.
Thanks in advance for any help you can offer.
Code:
Public Function Percentage(ByVal DCA As Integer, ByVal Team As String) As Double
Dim SiteDCA As Integer
Select Case Team
Case "BHM Lisa"
SiteDCA = Reports![rptRepStats_MTDReport]![subCSCDCAs]![BhmDca]
Case "CSC Barbara", "CSC Carly", "CSC Judy", "CSC Leah", "CSC Steve"
SiteDCA = Reports![rptRepStats_MTDReport]![subCSCDCAs]![SeaDca]
Case "CSC Deanne"
SiteDCA = Reports![rptRepStats_MTDReport]![subCSCDCAs]![MyghcDca]
Case "CW CS Agents"
SiteDCA = Reports![rptRepStats_MTDReport]![subCSCDCAs]![CwaDca]
Case "SPO CS Agents"
SiteDCA = Reports![rptRepStats_MTDReport]![subCSCDCAs]![SpkDca]
Case Else
MsgBox "Cannot locate team", 0, "Team Error"
End Select
Reports![rptRepStats_MTDReport].txtPct = DCA / SiteDCA
End Function
The basic expression is: DCA/SiteDCA
Seems simple, but the value of SiteDCA is dependant on the value of "Team", such as the Select Case statement.
Thanks in advance for any help you can offer.