Zero Suppression of calculated controls (1 Viewer)

skelley

Registered User.
Local time
Today, 08:33
Joined
Jul 11, 2000
Messages
69
How can I suppress zero values for calculated controls on a report?
 

skelley

Registered User.
Local time
Today, 08:33
Joined
Jul 11, 2000
Messages
69
No, not currency field. Is a text field with calculations typed in it using other fields data for the calculation. Result is a general number in some of the calc fields and is a percent in other calc fields.

thx
 
R

Richie

Guest
On Format event
If Me.YourTextName=0 Then
Me.YourTextName.Visible = False
Else
Me.YourTextName.Visible = True
End If
 

skelley

Registered User.
Local time
Today, 08:33
Joined
Jul 11, 2000
Messages
69
On Format event? What is that?
The text boxes that are showing zeros do not have any event available. The report does not have the "On Format" event as a selection. Please advise.

thx
 
R

Richie

Guest
Double click the detail selector of your report to open property sheet for that section you then have three options, select on format and paste the code into there, don't forget to compile and save.
HTH
 

skelley

Registered User.
Local time
Today, 08:33
Joined
Jul 11, 2000
Messages
69
This did not work either. One of the Textboxes is named "DH Prop" with a Control Source of =sum([DH-Proposal]), Standard format, decimal places = 0. This cell sums the hours reported from a timesheet table that were charged to DH-Proposal. If no hours were reported the resulting sum of course is 0. I would like to suppress the zero display on this and similar text boxes.

Thx
 
R

Richie

Guest
There are different problems with summed fields are the calculations carried out on the report or in an underlying query, have you named the code correctly it should read
If Me.DH_Prop = 0 Then
etc.
But in this case it may be easier to use the format property of the control as something like, #,##0.00[Black];(#,##0.00)[Red];0[White]
 

Users who are viewing this thread

Top Bottom