Senin, 30 Mei 2011

Re: [MS_AccessPros] Re: "Do not Print" blank fields.

 

Hi Robin,

the low-performance fast way is:

on the print OnFormat event of the section that the control is in:

'~~~~~~~~~~~~~~~~~~~
me.label_controlname.visible _
= iif ( IsNull(Me.controlname), False, True)
'~~~~~~~~~~~~~~~~~~~

for better performance, instead of a label, use a textbox control based on a calculated field with the equation:

'~~~~~~~~~~~~~~~~~~~
iif ( IsNull([fieldname]), Null, "Label for the field: ")
'~~~~~~~~~~~~~~~~~~~

performance is best if equation is in the RecordSource SQL or query.

If you don't care to format the label and the text differently, you can put them together:

'~~~~~~~~~~~~~~~~~~~
iif ( IsNull([fieldname]), Null, "Label for the field: " & [fieldname])
'~~~~~~~~~~~~~~~~~~~

Alternately, you can preface the equation with an equal sign = and put it in the ControlSource property of a textbox

then, TextBox PROPERTIES:

Height --> something small like 0.2" (easier to see than 0.1")
CanGrow --> True

when you have several controls in a section that grow only if they have data, keep in mind that everything with the same TOP property is evaluated, then the next Top property and so on ...

Warm Regards,
Crystal

*
(: have an awesome day :)
*

--- On Mon, 5/30/11, Robin Chapple wrote:

> I have returned to this subject 
> with a new report.
>
> Is there any way to not show the label if a field is
> empty?
>
> Many thanks,
>
> Robin Chapple
>
>
> At 27/07/2008 01:58 PM, you wrote:
>
> >Set the Report's detail section's CAN SHRINK property
> to YES and then
> >also the control's CAN SHRINK property to YES.
> >
> >Bob Larson
> >Access MVP
> >
> >--- In MS_Access_Professionals@yahoogroups.com,
> Robin Chapple
> ><robinski@...> wrote:
> > >
> > > I have a report in which one field occupies one
> line and when it is
> > > empty an ugly gap is left.
> > >
> > > How do I avoid the gap?
> > >
> > > Thanks,
> > >
> > > Robin Chapple
> > >
> >
> >

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar