Need to hide zeros in unused fields.

G

Guest

I have an Invoice database that has multiple line items to itemize services. There is an amount for each line item, which is a field. I would like to add up these amount fields for each invoice. The problem is, I don’t use every line, consequently, not every amount field. When they’re not all used – the result of adding these fields is nothing. I solved that by going into the table and making “0†the default value for each of these fields. This lets me show a total, but I don’t want the “0â€s showing. Is there a way to hide the “0â€s? Thanks for your help.
 
D

Dan Artuso

Hi,
You don't have to have a 0 value in the field.
Look up the NZ function in Help, it will let you 'set' the value to 0 for
your calculation without changing the value in your table.

--
HTH
Dan Artuso, Access MVP


Michele said:
I have an Invoice database that has multiple line items to itemize services. There is an amount for each line item, which is a
field. I would like to add up these amount fields for each invoice. The problem is, I don't use every line, consequently, not
every amount field. When they're not all used - the result of adding these fields is nothing. I solved that by going into the
table and making "0" the default value for each of these fields. This lets me show a total, but I don't want the "0"s showing. Is
there a way to hide the "0"s? Thanks for your help.
 
B

Bill Crawford

With the 'setvalue' command, make a macro to set the [Amount] field
visibility attribute to 'yes' or 'no' using an IIF statement in the
expression to check for 0 amounts ie.

iif([Amount]=0,"no","yes")

and use the macro with the OnPage or OnOpen event of the report.

Michele said:
I have an Invoice database that has multiple line items to itemize
services. There is an amount for each line item, which is a field. I would
like to add up these amount fields for each invoice. The problem is, I don'
t use every line, consequently, not every amount field. When they're not
all used - the result of adding these fields is nothing. I solved that by
going into the table and making "0" the default value for each of these
fields. This lets me show a total, but I don't want the "0"s showing. Is
there a way to hide the "0"s? Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top