How to make zero invisible in form with dataview

Blue6688

New member
Local time
Yesterday, 18:04
Joined
Jun 25, 2005
Messages
8
I have a form display project hours and also caculation of total for each project.

A user can spend time on multiple projects each day, I would like all zero invisiable. I had tried to set all default values to null (nothing) instead of zero. It causes problem in caculation of total.

I remember in Excel, it can make zero not to display, can we do this on an Access Form?

(Something I also want to know if this is possible. This is a time sheet, is anyway we can do on the form that projects (records) can be displayed horizonatally (on the top) while the dates can be displayed vertically (on the left), ,more like a transposed. But it would not change the struture of database (just display) so the date remains a field and projects are records.)

Thank you for help. Happy July 4th
 
Blue,

You can use Conditional Formatting on your form and print the 0 values
"white on white" which will make them invisible.

Or you can use the OnCurrent event of the form and for each field:

Code:
If Me.SomeField = 0 Then
   Me.SomeField.Visible = False
Else
   Me.SomeField.Visible = True
End If

Wayne
 
I assume this value to display would contain a fraction value such as 3.75 ...
You could use the following in the Format property of the control where the value is to be displayed ...

Try this:
0.0#####;;""

Then make sure you set the Decimal Places property to the actual number of decimal places to show in the control ...

RDH
 
I prefer to use Null as the default for numeric values. That way when a field contains 0, I know that that is the actual value that was entered. To use Null defaults, you simply need to understand how to work with nulls. You can read about them in help or here. Aggregate functions such as Sum() and Avg() ignore nulls. The only time you run into problems is when you create calculations. In those cases, you can use the Nz() function.
Nz(fldA,0) * Nz(fldB,0)
 
Thanks a lot

All great ideas, thank you very much.
 

Users who are viewing this thread

Back
Top Bottom