Data Reports: using the Function control


I am designing a report Using the Data Reports in VB 6.0.
I have 2 fields called Fees and Deposit respectively.

What i want to do is add the fields Fees at the end of the
report (using the Function control via Sum) and do the
same with also deposit.

Then I want to add the Fees total and the Deposit total
to get what I have called Final total.

Here's an example,

  Counter       Fees           Deposit

   1            1000             2000
   2            1000             2000
   3            1000             2000
               ________         _______
   Fees total  3000                6000 Deposit total
               ________         _______

   Final total: 3000+ 6000 = 9000

The problem I encounter is that you can't insert a Function
control in the Page Footer of the Data Report Designer.
You can insert it inside the Report Footer but than how do
I add the Fees total and Deposit total.

Any help please,


Who is Participating?
jamaussConnect With a Mentor Commented:

  If you go into your Data Environment and go to the Command you created, right-click and go to Properties. Then click the aggregates tab, you can define a grand total or total from fields within the database you're working with. After that, the total "query" will appear under the command and you can drag that onto the footer section of the data report designer.
meluAuthor Commented:
Thanks for your reply, BUT

I have tried what you do with No success. Doing so creates another field (total "query", as you point out) - but I can't not put that in my Data Report (i.e in the footer section). Why??
You can't put that in the footer section because it can only go into the details section or group footer section. Try Right-clicking in the details section and select "add group footer/header" and then drag the total field into that section and see if that works for you.
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

meluAuthor Commented:
Happy Millinimum,

Well it doesn't work. I did exactly as you suggest.

Has it got to do with the way i create my query??
Here is how i create the query called Subscription.

    Dim qdf As QueryDef
    Dim strSub As String
    dbs.QueryDefs.Delete "Subscription"       ' delete old query
   ' Create the query using DAO
   ' Use Text2 as the user input      

    strSub = "SELECT Surname, Date_Paid, Fees_paid From New_Member"
    strSub = strSub & " WHERE Month(Date_Paid) = '" & Month(CDate(Trim(Text2.Text))) & "'"
    Set qdf = dbs.CreateQueryDef("Subscription", strSub)
    If DataEnvironment1.rsSubscription1.State = 0 Then
    End If
    Subscription_DR.Show            ' Open the data report

Any suggestions...... as what's wrong???

Sorry, I'm not very good at Data reports in VB. However, I can suggest a solution for you. You can find it at Look for something called the Active Reports from DataDynamics. That's what I found and it better than even Crystal Reports.

meluAuthor Commented:
Thanks for trying,

so I 'll give you the 50 points

All Courses

From novice to tech pro — start learning today.