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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fields and labels for null values

Status
Not open for further replies.

mayday999

Technical User
Nov 20, 2006
17
US
Hi all,

I am putting together a report, is there an easy way to eliminate the field and the label if there is no entry for the field (ie null or empty string) Any help is greatly appreciated!

TIA

D
 
You can set the Visible property in the Detail Format event:

[tt]Me.txtText.Visible=Trim(Me.txtText & " ") <> ""[/tt]
 
Hi Remou,

This brings me to a couple more questions:

I have alot of fields in this report, about 50, does the line of code need to be inserted for each of the 50 fields? and I want the label gone as well

Next, I am sorry, but neglected to mention, will the fields move upusing this code or will there be a blank line for each field? the blank lines would probably make the report look awkward.

TIA

D
 
That is a little more difficult. You can set textboxes like so:

[tt]=IIf([Field1] Is Null,"","Field1Label: " & [Field1])[/tt]

Which incorporates the label into the textbox. If you make such a textbox quite short/thin, set Can Grow and Can Shrink to yes, and carefully match each textbox border to border, the gaps will close up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top