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

Displaying absolute value

Status
Not open for further replies.

mgbeye

Programmer
May 30, 2001
47
US
I am trying to display the absolute value of a field in the detail section of a report. I have tried quite a few formats but none will work. The report just says #ERROR instead of showing the value. The field name is Variance, can anyone help??
 
Make sure that the name of the control is DIFFERENT than the name of the field. Here's the control source you need:

=Abs([Variance])

HTH Joe Miller
joe.miller@flotech.net
 
Just to add to what Joe has responded -- remember that a format only changes the way things look, not the actual stored values. For example, I can change a date's format to look like this: 6/12/01 or this: June 12, 2001 and so on. Nothing, however, has changed in the underlying data when I did that.

In this case, what you are trying to do is to calculate a NEW value based on existing data. As Joe pointed out, you can't put that new value back in the same place as the original value -- you have to create a new spot to show it. That's your new control which might be called txtAbsolute.

To derive the value of the txtAbsolute control, you want to take the Variance value and run the Abs function on it. This is one of Access' built-in functions (check it out in the Help). Then you assign the result of that function to the txtAbsolute control.

Make sense?

Pamela
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top