Hide object based on Yes/No field

A

adna

Hi,
I want to hide an object on a report if the value of the yes/no text box =
no or 0
I keep getting an error "you entered an expression that has no value"
What am I doing wrong?

Here is my code from reports event Open:
If Me.txtcheckbox = "0" Then
Me.objectOne.Visible = False
End If
 
D

Douglas J. Steele

It's 0 (or False), not "0"

Even simpler would be:

Me.objectOne.Visible = Me.txtcheckbox
 
A

adna

Douglas,
Thanks for your reply
I tried your code below and got another error:
Runtime error 13
Type mismatch
 
A

adna

I think I found out what was causing the problem. I had the code in the
Report Open Event but after moving it to the OnFormat Event of the detail I
no longer get the errors.
 
Top