var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: help with report calculation
Can someone help me with the following calculation?
I have a report with a column with the following:
field1 = 10.00
field2 = 20.00 (not visible)
field3 = 30.00 (not visible)
field4 = 40.00
How can I total the values where the fields are visible therefore my total should be 50.00? Keep in mind that the non-visible fields have values in them.
NEED HELP URGENTLY
I have done similar things using forms. Just check all the controls in your form of the type text. If they are visible add up else do nothing
Private sub CountTotal(ctrl As Controls)
Const vbTextBox = 109 ' means is textbox
Dim intProperty As Integer
dim intTotal as integer
Dim i As Integer
intTotal = 0
For i = 0 To ctrl.Count - 1
intProperty = ctrl(i).Properties("ControlType")
If intProperty = vbTextBox And ctrl(i).visible Then
intTotal = intTotal + ctrl(i).value
MyReport.total = intTotal
call the function like this:
I hope that it also works for reports but I think you can use this in the On_Open event of your report.
hope it helps
Can you give us a bit more detail?
Are fields one through four, four separate textboxes in the detail section of your report.
Are they each bound to the report's sourceobject?
Why are fields two and three invisible? Are you toggling them invisible in the OnFormat event of the detail section.
Is this total field in the detail section of the report, or in some footer section?
Try to use the function 'IF()', in the control source property
had a new control to do parcial sums
you had 4 controls in your report: field1; field2(N.V); field3(N.V); field4
create a control for example: field5, in the control source put
Now you can have a parcial sum
Last edited by Miguel; 04-13-02 at 00:51.