UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Hide Caption If Value Is "", Office 2003    
 
   
brandsrus
post Apr 10 2012, 02:42 AM
Post #1

UtterAccess Member
Posts: 30



Is it possible to hide caption if a value is "" in a report?

Attached File  untitled.jpg ( 55.19K ) Number of downloads: 11


In the example is "Dagdienst" have no value so i will hide this but how can i do this?

Thanks.

Go to the top of the page
 
+
arnelgp
post Apr 10 2012, 03:04 AM
Post #2

UtterAccess Ruler
Posts: 1,090



You can make the caption somewhat "invisible" by setting its ForeColor Property to White (vbWhite)

On Format Event of Detail Section of Report (you must click the Detail band).


CODE
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    IF yourTextBoxFieldToCheck = "" Then                 '<= //NOTE: place the correct controlname
        me.yourLabelControl.ForeColor = vbWhite        '<= //NOTE: place the correct controlname
   Else
        Me.yourLabelControl.ForeColor = vbBlack         '<= //NOTE: place the correct controlname
   End If
End Sub
Go to the top of the page
 
+
pere_de_chipstic...
post Apr 10 2012, 03:19 AM
Post #3

UtterAccess VIP
Posts: 7,590
From: South coast, England



Hi brandsrus

An alternative is to replace the label by a text box, and make the new text box control source =IIF(NZ([SomeFieldName],"") = "","","Dagdienst")

hth
Go to the top of the page
 
+
brandsrus
post Apr 11 2012, 04:17 AM
Post #4

UtterAccess Member
Posts: 30



Thanks for the solution; i have added the solution from "arnelgp"

One more question; is it possible to hide the space if the fields are empty.

In the meanwhile if there is no value the empty space will be visible. The situation will be that the empty space will be filled with the values of the other fields to move to above or something.

Thanks for advance.
Go to the top of the page
 
+
arnelgp
post Apr 11 2012, 05:04 AM
Post #5

UtterAccess Ruler
Posts: 1,090



Click on Each control in your Report and on its Property Sheet -> Format ->Can Grow = Yes , Can Shrink =Yes
Go to the top of the page
 
+
pere_de_chipstic...
post Apr 11 2012, 06:14 AM
Post #6

UtterAccess VIP
Posts: 7,590
From: South coast, England



Hi brandsrus

As arnelgp suggests you can use the Can Grow and Can Shrink properties, however label controls do not have can grow/shrink properties and you will either have to use a standard text box for your label or add code to adjust the height of the labels in the on format event.

Also remember that you should also set the Can Grow and Can Shrink properties of the section these controls are placed in.

hth
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 04:25 PM