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!

Set Property Visible on a report

Status
Not open for further replies.

Fiora

Technical User
Feb 26, 2001
34
US
I have a field that I would like to set the Label as visible, only if the text box is not null.

ex. the field name is "List Price" if the amount is null, I don't want the Label "List Price" to print on my report.

Does anyone know of a way to do this?

Thanks.
 
On the Open event of the report do this:


If ListPrice is Null then
ListPrice.visible = false
Else
ListPrice.visible = true
Endif

HF
 
This returns a run time error 424 object required. When I click on OK, the first line of code is highlighted.
 
If Me.ListPrice = Null then
Me.ListPrice.visible = false
Else
Me.ListPrice.visible = true
Endif
HF
 
Now I get an run time error 2420
You entered an expression that has no value
The expression may refer to an object that has no value, such as a form, a report, or a label control.

Is is possible this can't be done in a report?
 
Rather than making a label and using the code above, make a text box and put this as it's control source:

=IIf(IsNull([List Price]),"","List Price")

Now this textbox will look at List Price, if it's null it will set itself to nothing ("") and "not show."

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top