[sub].Visible = [sub].Value

  • Thread starter Thread starter Leslie Isaacs
  • Start date Start date
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
 
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
 
Back
Top