Manipulating grouping with code or formula.

jplink49

Registered User.
Local time
Today, 08:56
Joined
Mar 13, 2008
Messages
18
I have a field [ACMT] on my report that holds analysis comments; it [ACMT] resides in the Footer section of my report. The problem is my analysis comments do not show on my report. I learned that the Footer section only displays values in the last record of the table (the record source of the report), as oppose to the Detail section, where a unique value would be displayed once per line from the table. (I can see this when I move the [ACMT] field into the Detail section;here I see the analysis comment no matter which record it's found). With my current report set-up, I'm only going to see analysis comments if ithey happen to be in the last record of the table.

My question is: How can I manipulate my report with VBA code or formula to get the [ACMT] in the Footer Section to display an analysis comment any record in the field?This is what I did:
1.Placed [ACMT] in the Detain section but made it invisible.
2.Then I defined a global variable for the report: DIM ACOMMENT AS STRING
3.Then in the detail code, put:
If Me.ACMT <> "" then
ACOMMENT = Me.ACMT
End If
4.Then in the Footer Section, added an unbound text field called, ACMT_Field
5. In Footer, add code thats says Me.ACMT_Field = ACOMMENT

It looks like this...

Option Compare Database

Dim ACOMMENT As String

Private Sub Detail1_Format (Cancel As Integer, FormatCount As Integer)
If Me.ACMT <> "" Then
ACOMMENT = Me.ACMT
End If
End Sub

Then in Footer..

Private Sub PageFooter2_Format (Cancel As Integer, FormatCount As Integer)
Me.ACMT = ACOMMENT
End Sub

Despite this I still don't see my comments. What is wrong?
 

Users who are viewing this thread

Back
Top Bottom