I have a report with 2 levels of groupings and in the detail section I have about 25 fields that can have a value of 'NFE'
The code I placed in the detail section looks at all the controls in the detail section and adds '1' evertime 'NFE' is a value. I then pass that value to an unbound text box on the detail line, [text113]
That portion works fine. But I am unable to sum that afterwards in any of the group footers. I've tried referring to the field and performing the sum 'over group' and also just using the Sum([text113]). Either I get unexpected results or it won't let me. I suppose what I am trying to do is close to a cross-tab query.
What would be the easiest way to now take those values from [text113] or the variable totalNSE and get sums in the 2 footers I have and then for the whole report.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim totalNSe As Integer
Dim totalSp As Integer
Dim totalSpT As Integer
Dim ctl As Control
totalNSF = 0
totalNse = 0
For Each ctl In Me.Detail.Controls
'Debug.Print ctl.Value
If ctl.Value = "nfe" Then
totalNSe = totalNSe + 1
'Debug.Print totalNSe
Else
End If
Next ctl
'Debug.Print totalNSe
Text113 = totalNSe
The code I placed in the detail section looks at all the controls in the detail section and adds '1' evertime 'NFE' is a value. I then pass that value to an unbound text box on the detail line, [text113]
That portion works fine. But I am unable to sum that afterwards in any of the group footers. I've tried referring to the field and performing the sum 'over group' and also just using the Sum([text113]). Either I get unexpected results or it won't let me. I suppose what I am trying to do is close to a cross-tab query.
What would be the easiest way to now take those values from [text113] or the variable totalNSE and get sums in the 2 footers I have and then for the whole report.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim totalNSe As Integer
Dim totalSp As Integer
Dim totalSpT As Integer
Dim ctl As Control
totalNSF = 0
totalNse = 0
For Each ctl In Me.Detail.Controls
'Debug.Print ctl.Value
If ctl.Value = "nfe" Then
totalNSe = totalNSe + 1
'Debug.Print totalNSe
Else
End If
Next ctl
'Debug.Print totalNSe
Text113 = totalNSe