Invoice Print, Show extra 'Info' Line if the field is populated, hide if not

veraloopy

Registered User.
Local time
Today, 23:00
Joined
Apr 10, 2009
Messages
139
I've got an invoice report all set up which works perfect, however, I'm now being asked to add an additional information line for each item on the invoice but only print it when it has been populated

The extra information field is the easy bit, I've done that and added it underneath the existing item description field on the report. I've used the following code to hide the extra info line if it is blank, however, the report then just leaves a gap in the print out for each item where the extra information line is blank.

How do I get the report to only print the additional information field if it is not blank and close the gap if it is blank?

Code:
if me.ItemAddInfo="" or isnull(ItemAddInfo) then
                me.ItemAddInfo.visible = False
          end if

As always, any help is greatly appreciated :)
 
Another way to do this:
Code:
If Len(me.ItemAddInfo & "") = 0 Then
   Me.ItemAddInfo.visible = False
Else
   Me.ItemAddInfo.visible = True
End If
What event has this code? Do you have the "CanShrink" property for the Section and control set to YES?
 
What I do in design view is give the notes textbox a zero height, and set it's CanGrow property to True. Make sure the CanGrow property of the containing section is also set to True.
Then, if there's no data the control has zero height, and if there is data it gets as big as it needs to.
Cheers,
 
What I do in design view is give the notes textbox a zero height, and set it's CanGrow property to True. Make sure the CanGrow property of the containing section is also set to True.
Then, if there's no data the control has zero height, and if there is data it gets as big as it needs to.
Cheers,
I like it! Coming at it from the other direction.
 
Thanks guys, I have tried the CanGrow & CanShrink property before but it didnt help, however, I didnt check that the containing section was also set to True

I'm going to try these out to see if it resolves the problem and will let you know

Thanks again :):):)
 
where are you including this code

the two places to try are in the

format and print events of the section (possibly detail) that contains them.

it's always trial and error to me - some things work in either event - others seem not to
 
What I do in design view is give the notes textbox a zero height, and set it's CanGrow property to True. Make sure the CanGrow property of the containing section is also set to True.
Then, if there's no data the control has zero height, and if there is data it gets as big as it needs to.
Cheers,

This seemed the easiest of the two suggestions and it worked first time :) I hadn't set the property within the containing section hence why it didn't work before.

I'm so excited as this has been bugging me for some time now :D:D:D

Many thanks again for all your help - very much appreciated
Cheers!!
 
You're welcome you guys. I'm glad that you're glad. :)
 

Users who are viewing this thread

Back
Top Bottom