So I have 5 check boxes called Act1, Act2, Act3, Act4,Act5 and I want to calculate a number (100 when all checked) in another field called percentcomplete. How would that work?
Thanks in advance!
Access 2007
So I have 5 check boxes called Act1, Act2, Act3, Act4,Act5 and I want to calculate a number (100 when all checked) in another field called percentcomplete. How would that work?
Thanks in advance!
Access 2007
in the form OnCurrent event procedure and each checkbox AfterUpdate event procedure put
percentcomplete = abs(Act1 + Act2 + Act3 + Act4 + Act5)/5
You also may want to consider putting this code in a function, then call the function from the event procedures indicated above.
Perfect! How about if each Act has a different weight? Say Act 1 = 10% and Act 2= 35%?
Thanks again!
You could put the weight for each in the tag property of each checkbox control. Using 10 for 10 percent, you could calculate:
percentcomplete = (cint(Act1.tag) + cint(Act2.tag) + cint(Act3.tag) + cint(Act4.tag) + cint(Act5.tag))/100
I'm probably wearing out my welcome on this subject... But what if I wanted a different weight for Act1 depending on the type of main tag number. For example: If TagType=1 then Act1=10, but if TagType=2 then Act1=15. I thought about making more fields, Weight1 Weight2.... then setting the value of them fields after updating the check box Act 1. I'm sure this would be easy in VBA code, I'm just not that experienced with VBA.
I swear this will be my last question on this subject... lol
Got it figured!