[sub].Visible = [sub].Value

L

Leslie Isaacs

Hello All

I have a report that includes the yes/no field [sub] in the detail
section.
I would like this field only to be visible when its value is "True". I
thought I could do this very neatly by adding:

[sub].Visible = [sub].Value

to the report's OnOpen event, but this doesn't work - I get:
Runtime Error 2427 You entered an expression that has no value.

I can't understand this - surely both sides of the "=" are booleans and I
should be able to set one from the other?
This is probably laughable to most of you, but I would be grateful if
someone could explain why my expression doesn't work.

Many thanks
Leslie Isaacs
 
A

Allen Browne

Move your code into the Format event of the Detail section.

If the goal is to end up with a checked box for Yes and just white space for
No, you could also use this trick:
Check boxes on reports: change the size, color, unbox them,
and use conditional formatting
at:
http://allenbrowne.com/ser-52.html
 

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

Top