Question : MS Access Report Hide\Display a textbox or label

Hello

I need to hide or display a textbox(or label or rectangle) on an XP access report.
the report is linked to a query and the query has a field blnWrap.

In the detail section of the report I want to hide or display a field called txtCover depending on whether the clnWrap field is true or not.  I dont see any event on the blnWrap checkbox field on the report or on the txtCover field.  I also tried creating a lblcover but that had no event option either.

I assume I need to do something like iif(blnWrap = true, txtCover.visible = false, txtCover.visible = true) - Where do I put this code so that each line on the report display or hides the textbox depending on the boolean of each record.

Help?

Answer : MS Access Report Hide\Display a textbox or label

Use the Detail section's .OnFormat event instead of a control event:

Private Sub Detail_OnFormat()

If Me.clnWrap = True then
   Me.txtCover.Visible = True
else
   Me.txtCover.Visible = False
end if

end sub

Hope this helps.
-Jim
Random Solutions  
 
programming4us programming4us