Hide object based on Yes/No field

  • Thread starter Thread starter adna
  • Start date Start date
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
 
It's 0 (or False), not "0"

Even simpler would be:

Me.objectOne.Visible = Me.txtcheckbox
 
Douglas,
Thanks for your reply
I tried your code below and got another error:
Runtime error 13
Type mismatch
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top