Hide Text box

B

Bob V

If I have a text box on my report called [tbTax] and if the text box is
showing 0 or Null , what code do I need to make it not visible?
Thanks for any help....Bob
 
J

Jeff Boyce

Bob

If you have only the textbox (and not an accompanying label), having Null in
the underlying field would mean there was nothing there to show on the
report.

One approach to changing the visibility of the control would be to add
something into the OnFormat event of the report, perhaps:

tbText.Visible = Nz([tbText],0)<>0

Or you could use that Nz() function in a query underlying your report and do
your conversion before the report even sees it.

Note that .Visible = False does NOT shrink up the space taken by the control
on the report. To do that, you need to use the CanShrink (and CanGrow)
properties.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

Bob V

Thanks Jeff, Worked Perfect :)) Bob
Jeff Boyce said:
Bob

If you have only the textbox (and not an accompanying label), having Null
in the underlying field would mean there was nothing there to show on the
report.

One approach to changing the visibility of the control would be to add
something into the OnFormat event of the report, perhaps:

tbText.Visible = Nz([tbText],0)<>0

Or you could use that Nz() function in a query underlying your report and
do your conversion before the report even sees it.

Note that .Visible = False does NOT shrink up the space taken by the
control on the report. To do that, you need to use the CanShrink (and
CanGrow) properties.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Bob V said:
If I have a text box on my report called [tbTax] and if the text box is
showing 0 or Null , what code do I need to make it not visible?
Thanks for any help....Bob
 
S

serviceenvoy

If you have only the textbox (and not an accompanying label), having Null
in the underlying field would mean there was nothing there to show on the
report.
One approach to changing the visibility of the control would be to add
something into the OnFormat event of the report, perhaps:
tbText.Visible = Nz([tbText],0)<>0
Or you could use that Nz() function in aqueryunderlying your report and
do your conversion before the report even sees it.
Note that .Visible = False does NOT shrink up the space taken by the
control on the report. To do that, you need to use the CanShrink (and
CanGrow) properties.

Jeff Boyce
Microsoft Office/Access MVP
If I have atextbox on my report called [tbTax] and if thetextbox is
showing 0 or Null , what code do I need to make it not visible?
Thanks for any help....Bob

I have a similar problem that I would like to see if you could help me
with. I have a query that pulls part descriptions but if the
description says "sales tax" I don't want that one description to show
on my query results. Is it possible to do that?
 
Top