Link to home
Start Free TrialLog in
Avatar of developingprogrammer
developingprogrammer

asked on

using vba to sum subform values

hey guys,

i know that if i want to sum the subform's records for a particular field i can put a textbox in the header or footer with the control source of "=sum([fieldname])"

however, how can i do it with VBA?

i want to sum it based on the subform's recordset not a dsum using the same criteria. essentially what the user sees should be what is being summed. (excluding filters - they're disabled = ))   )

thanks in advance guys!!!! = ))
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of developingprogrammer
developingprogrammer

ASKER

Yup guys, I want to try and be as consistent as possible by using the same recordset. But instead if loop through each of them, is there a faster way gustav? Something that does it all at one go
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok cool thanks gustav!! Thanks boag2000 as well!! = ))
You are welcome!

/gustav
Thanks, but I really was not seeking any points, I was just curious...

You can give all the points to cactus_data

JeffCoachman
Not a problem for me, Jeff.

/gustav
well Jeff your question have always helped me question myself in a very constructive way too so if gustav doesn't mind i would like to show my appreciation for you taking a look at my question and helping me out! = ))
Sometimes asking questions actually helps me learn too...

Sometimes a person will have an interesting reason for asking a question...

;-)

Jeff
Haha yup yup I've noticed and I've learnt so much from all the questions people've asked on my behalf prior to me even thinking of it!! Haha = )) thanks Jeff!! = ))