Hide empty fields on report

3699wat

Registered User.
Local time
Today, 17:44
Joined
Oct 28, 2002
Messages
83
I have a report with multiple fields (textboxes and corresponding labels). They are all lined up horizontally one under the other. The form is bound to a table populated through a form. Not all fields will be populated on that form for each record. I would like to set a procedure on the OnOpen event (or any other suggestion?) of the report so that all empty field AND corresponding labels are not visible and so that all lines will move up so no gaps are left in between.
I know how to set code to make individual textboxes and labels not visible if empty, but like a way to do it for all the empty ones at one time.
 
Have you tried using the CanShrink Property?
 
The Canshrink property is set to yes and will do the trick if the label is set to invisible. I know how to set the code for an indidividual field, but like to have one that would do the trick for all fields that are empty on that particular report.
 
Just tried the canshrink value set to yes
and the label to visible:no

And now you can't see the field on the report whether it is null or not..am i missing something?
 
If you have a field [A] and a field and field [A] is null and has a value, you are saying that the value of should now be shown in [A] - yes?

If so you'll probably need to sort that out at query level. Possibly with nested IIf statements. e.g. IIf(IsNull([A],,[A])) but keep nesting them in the true and false bits.

Having said that, I'm only guessing and I feel sure someone will say if this is not a suitable approach.

Col
:cool:
 
Hi Col,
Sorry..Don't think i explained properly.
I have a field called 'renewal date' on my report.
If this field is null in the form the report is based on, i just don't want the label 'renewal date' to show up. Nothing needs move, i think its quite a basic problem!?:D
 
Umm hang on.......confused now

Are you the same person as 3699watt who posted the problem?:confused:

Col
 
Yes I remember - Sarah isn't it?

If you followed the age discussions in the watercooler yesterday you'll understand why I'm easily confused!! sorry

I was relying to 3699wat's question. I can't see your question.

Col
:cool:
 
Yep..Sarah it is!!

My question was just above your reply...kinda similar!!
 
Hey there
Since you both kinda hopped into this post, maybe you could help.
Again I need code that will look for ALL empty textboxes in a detail section and make ALL corresponding labels invisible.
I have about 20 boxes on the report and don't like to repeat the same code over and over. Actuallt I tried and they kinda interfere with each other.
Thanks
Marcel
 

Users who are viewing this thread

Back
Top Bottom