Hiding a control and label

  • Thread starter Thread starter Harv Lake
  • Start date Start date
H

Harv Lake

Hi, Hope you can answer this for me.

I have a query that I'm doing a report on and would like
to have a conrol hidden if the value in another box is a
certain value. Let me explain more about the recordset.

Equipment TonsPerHour

Loader 3
Boiler
DumpTruck 6

I would like to not have the label TonsPerHour show up
for Boiler as it will always be empty anyways.

Any suggestions would be appreciated.

Harv
 
The best way to do it is go to the report Record Source,
then choose ... and create your table there, then under
criteria and under the field of TonsPerHour, key in
Not Is Null

May
MCP in Access and SQL Server
 
Harv said:
I have a query that I'm doing a report on and would like
to have a conrol hidden if the value in another box is a
certain value. Let me explain more about the recordset.

Equipment TonsPerHour

Loader 3
Boiler
DumpTruck 6

I would like to not have the label TonsPerHour show up
for Boiler as it will always be empty anyways.

Not sure I followed that (probably because it looks like
your table is not properly normalized). Assuming that the
label is attached to the TonsPerHour text box, I think you
might want to use a line of code in the detail section's
Format event:

Me.txtTonsPerHour.Visible = Not IsNull(Me.txtTonsPerHour)

Make sure the detail section and the txtTonsPerHour text box
have CanShrink set to Yes.

If your table is properly normalized, then just filter out
the records with a Null in the TonsPerHour field.
 
click on the detail bar in design view
go to On Print event, key in
if isnull(Tonsperhour) then equipment.visible = false

May
MCP in Access and SQL Server
 
Back
Top