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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abs Function

Status
Not open for further replies.

JoelK

Technical User
Mar 13, 2001
2
GB
I need to convert a series of negative numbers generated by adding the totals of check boxes.

Can I use the Abs function to do so and, if so, how can I do this?

If the Abs function won't work, is there another way of converting these negative totals to positive, either in a query or a report?
 
yes, use the Abs() in a query and the Abs() and NZ() functions on a form

this example uses 5 Yes/No Fields
Total Cs: Abs([c1]+[c2]+[c3]+[c4]+[c5])

this example adds the checkboxes on a form *using the AfterUpdate() Event for each checkbox and storing that value into a textbox on the form
txtTotal = Abs(Nz(Me.chk1, 0) + Nz(Me.chk2, 0) + Nz(Me.chk3, 0) + Nz(Me.chk4, 0) + Nz(Me.chk5, 0))

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top