JuniorWoodchuck24
Registered User.
- Local time
- Today, 06:38
- Joined
- Jan 13, 2010
- Messages
- 59
I have a report that pulls data in from a table and query. The query runs a product calc and what I'm trying to do is to put a function in VBA to show the product sum per group. The issue I'm having is that it finds the first groups answer and repeats it through the list of groups. For example:
Group A total = 1000
Group B total = 200
Group C total = 100
So the report shows:
Group A total = 1000
Group B total = 1000
Group C total = 1000
Me.GroupTotal = IIf(Group="A", ProductSumA, IIf(Group="B", ProductSumB, IIf(Group="C", ProductSumC,"")))
Is what I typed in VBA, and if I type the same thing in the text box's ControlSource it works. Only issue is that my IIf statement is much bigger than the example and if I type it in the ControlSource is gives me a error saying text is too long to edit.
Is there a certain function that I need to use to have it continually check the Group header?
Group A total = 1000
Group B total = 200
Group C total = 100
So the report shows:
Group A total = 1000
Group B total = 1000
Group C total = 1000
Me.GroupTotal = IIf(Group="A", ProductSumA, IIf(Group="B", ProductSumB, IIf(Group="C", ProductSumC,"")))
Is what I typed in VBA, and if I type the same thing in the text box's ControlSource it works. Only issue is that my IIf statement is much bigger than the example and if I type it in the ControlSource is gives me a error saying text is too long to edit.
Is there a certain function that I need to use to have it continually check the Group header?