Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make text boxes and labels invisible in a report

Status
Not open for further replies.

BMcMakin

Programmer
Oct 21, 2003
16
US
Hi,

I want to make a text box and a label on my report invisible if the value of the text box is 0. If the textbox is other than 0 I want it to be visible.

I am not really a programmer so I don't know the syntax of code but I have tried to do it using the expression builder like this...

IIF ([Adjusted_Price]=0,[Adjusted_Price].visible=false, [Adjusted_Price].visible=true)

This doesn't work though. Anybody have another suggestion?
 
BMcMakin
Try this...

1. Right Click on the Detail section bar, and select Properties.
2. Double Click n the OnFormat event to show [Event Procedure], and then click the elipses (...) at the right hand side. That will take you to the VBA editor.
3. Enter this code...
Code:
If Me.Adjusted_Price = 0 then
Me.Adjusted_Price.Visible = False
Else
Me.Adjusted_Price.Visible = True
End If

4. When you are finished entering that code, click Compile on the Debug tab.

Tom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top