Link to home
Start Free TrialLog in
Avatar of bill201
bill201

asked on

how to make a condition in a report in access 2010 not to show a field

hi

i want to make a condition in access that if a field is equal zero not to show it in a the printable report
i put in the event current report this code:
if not retail >0 then
retail.visiable=false
end if
but it's not worked and the field is visiable anywah
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

use the format event of the detail section ofthe report if [retail] is in the detail section

private sub detail_format(Cancel As Integer, FormatCount As Integer)

me.[retail].visible= not me.[retail]>0

end sub
Avatar of bill201
bill201

ASKER

it's not working but actually  i don't paste the entire code and maybe is this matter

this is my entire code includet what i try to do do accordingly you comment :

Private Sub detail_format(Cancel As Integer, FormatCount As Integer)


Dim d As String

d = Nz(DSum("retail", "orderdetailst", "orderid=" & Me.OrderID), 0)
If Not d > 0 Then
Me.[Retail].Visible = Not d > 0
End If
End Sub

and the dsum worked (i tried bfore)
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial