Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I created a report that lists accou

Status
Not open for further replies.

dzdncnfsd

MIS
Jul 14, 2000
118
US
I created a report that lists accounts greater than 89 days old and grouped them by status codes. In a group footer, I want to show how many are over 120 days old. I put this on the control source line of the "#days" text box property window: =Count([Over120] > 119), but it still counts everything in the group regardless of how old the account really is. There must be a simple way to do this. Does anyone have any suggestions?
Thanks,
Gladys X-)


Gladys Clemmer
gladys.clemmer@fifsg.com

 
One way that I use is to declare a module level variable in the report and use the Detail_format event to iterate the variable. Then print the sum in the footer. Example:

Private iCount as Integer

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Age >= 120 then
iCount = iCount + 1
End if

End Sub


Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

Me.<yourtextbox> = iCount

End Sub

 
Thanks, gwinn7. I tried what you said, and it returns numbers, but they aren't correct. For instance, one group only had one record, but it returned a value of 26. I will keep playing with it, but if you have any suggestions, I'd be glad to hear them. This is what I did:

Private iCount as Integer

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtDays >= 120 then
iCount = iCount + 1
End if
End Sub

Private Sub ftrOver120_Format(Cancel As Integer, FormatCount As Integer)

Me.txtOver120 = iCount

End Sub



Gladys Clemmer
gladys.clemmer@fifsg.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top