Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Box Total

Status
Not open for further replies.

hdat44

Technical User
Aug 15, 2002
50
0
0
GB
Hi, i would like to have four check boxes on a form and a total box at the end so that as each box was ticked the total box would advance in increments of 3. can this be done??
 

Something like this?
Code:
=abs(sum(checkbox1 + checkbox2 + checkbox3 + checkbox4)) * 3

Randy
 
where would i put that code??
 
ControlSource property of total box:
=3*Abs(checkbox1+checkbox2+checkbox3+checkbox4)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya hdat44 . . .

Although [blue]randy700[/blue] & [blue]PHV[/blue] have the formula, I don't believe checkboxes will trigger a [blue]ReCalc[/blue] to keep the total in sync with their state changes. You'll know because the [blue]total won't update![/blue]

If the above is true ... simply add [blue]Me.ReCalc[/blue] in the [blue]After Update[/blue] event of each checkbox.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi This has worked but the totals do not transfer back to the totals field in the table. aslo could i put a message box on this when the total has reached 12??
 

Why would you want to transfer the totals field to the table? It is not considered good practice to store calculated values. The totals can be obtained
from a query if you need them for a report and are all ready being calculated for the form.

Add your message box to the after update event of each check box.

Randy
 
I agree you shouldn't need the totals, all you really need is to query the totals and get that froma report you run.

- Wade Stoddard

Wade Stoddard
IT Manager
USA
 
IMO, "four check boxes" raises a red flag regarding normalization. Why not three? What happens when you decide your business needs suggest six? My concern is these four "values" should be stored in four related records. I could be wrong.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top