Zeros in a form

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I have a form that adds values together from different
totals in textboxes and displays the "Grand Total" in
another textbox. My problem is, not all of the boxes that
are used to calculate the total will contain values. How
would I set up the form so that:
A. The zeros on the form are not displayed unless there
is a value in the textbox
AND
B. The "Grand Total" box still calculates without all of
the textboxes containing data are filled.

Any help would be greatly appreciated!
Thanks, Eric
 
Eric, an easy way to not display zeros, would be to change the format setting of the field.

an example for the format property setting of the field would be: 0.00;-0.00;""
my example uses two decimal places, you could change it to whatever you like

the first part is how positive numbers are shown separated by a semicolon
the second part is how negative numbers are shown separated by a semicolon
the third part is how zero values are handled. In this example, a double-quotation will display what is called a zero-length string, so it appears to be empty, even though the value is actually zero

there can even be a fourth format which is how Access handles null values, but since you said there would be zeros in the fields, but you just don't want to show zeros, if I understood your question, than you can skip that part.
 
Back
Top