My Assistant
![]() ![]() |
|
|
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?
untitled.jpg ( 55.19K )
Number of downloads: 11In the example is "Dagdienst" have no value so i will hide this but how can i do this? Thanks. |
|
|
|
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 |
|
|
|
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 |
|
|
|
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. |
|
|
|
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
|
|
|
|
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 Top · Lo-Fi Version | Time is now: 23rd May 2013 - 04:25 PM |