Unanswered: How can i sum textbox that calculated from function ?
I have 2 textboxs.
First textbox is in detail section
Second textbox is in GroupFooter0 section
I have written the funtion for calculate first textbox .
And I want to sum second textbox too.
I used to use Sum([first textbox]) on Control Source of the second textbox
But It occured the input dialog and show the name of first textbox before show the report (the input dialog show after click open the report)
What cause does this problem has?
So, I have written another function for sum second textbox (cuz Could not sum with Sum([first textbox]) )
The code of last function is:
Function SumMPay(longMPay As Long) As Long
Dim i As Integer
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("select deb_id from deb_list where deb_month= " & Reports![Deb_List_Report_By_Month]![Deb_Month] & " and deb_year = " & Reports![Deb_List_Report_By_Month]![Deb_Year])
For i = 1 To rst.RecordCount
SumMPay = SumMPay + longMPay
I have used this function at :
Private Sub GroupFooter0_Print(Cancel As Integer, PrintCount As Integer)
second textbox = SumMPay(first textbox)
Now Can open the report without any input dialog and
Second textbox can show the value
some value on the second textbox incorrect !
Anyone have any idea ?
If it is possible it is much easier to sum the field from the input query.
>> If the field you want view and sum is lets say [Item Cost] then text box 1 (In detail) will have a control source of "[Item Cost]". then in your footer text box 2 will have a control source of "=SUM([Item Cost])"
I forget told u that I have already used "=Sum([first textbox])" at the control source of second textbox .
Then I have tried use over group or over sum at running sum property of second textbox too.
But when open the report (Now no using my function)
it occured the input dialog (input parameter dialog) yet.
I thought occurrence the input dialog before the report will be opened will relate with the control source of both textboxs ?
cuz There is the name of first textbox at the input dialog .
cuz The control source of first textbox had not get from the table , but the value of first textbox got from calculation of my function(first textbox is just summation of my function).
So, It occured the input dialog !
So i could not use =Sum() ?!
Please help me again , I am sorry for repeat post (but I have edited my post in another post)