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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Hiding And Moving Empty Fields And Labels, Access 2013    
 
   
wagman
post Apr 14 2020, 03:15 PM
Post#1



Posts: 260
Joined: 12-March 08



I am building a report that will not always have values in some of the fields.

When those fields are empty, I want to hide them. No problem...I have that covered using some quick VBA code: Me.EmptyField.Visible = Not IsNull(Me.EmptyField).

What I am curious about is if I have a field and label that are not visible, can the field on the next "line" move up, so there is no apparent gap in the report?

Instead of seeing this, when field and label 3 are not visible:
Label 1: Field 1
Label 2: Field 2

Label 4: Field 4
Label 5: Field 5

I would like it to look like:
Label 1: Field 1
Label 2: Field 2
Label 4: Field 4
Label 5: Field 5

Not a big deal. just wondering if this is an easy task or not.

Go to the top of the page
 
GroverParkGeorge
post Apr 14 2020, 03:56 PM
Post#2


UA Admin
Posts: 37,239
Joined: 20-June 02
From: Newcastle, WA


There is a "Can Shrink" property for controls. See if that can achieve the desired result.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
tina t
post Apr 14 2020, 04:00 PM
Post#3



Posts: 6,588
Joined: 11-November 10
From: SoCal, USA


as George says. i think you'll also have to set the same property for the report section that the controls are in.

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
wagman
post Apr 15 2020, 10:23 AM
Post#4



Posts: 260
Joined: 12-March 08



The 'Can Shrink' works with the control, but not the label.
Go to the top of the page
 
RJD
post Apr 15 2020, 11:08 AM
Post#5


UtterAccess VIP
Posts: 10,496
Joined: 25-October 10
From: Gulf South USA


Hi:
QUOTE
The 'Can Shrink' works with the control, but not the label.

Yes, but you can get around that by using a textbox control instead of a label. In the "label" textbox control put something like ...

=IIf(IsNull([MyField]),Null,"My Label Words")

Then use Can Shrink.

Actually, I sometimes set the height of the textboxes to essentially zero, then use Can Grow. But looks like Can Shrink is good here.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
RJD
post Apr 15 2020, 11:28 AM
Post#6


UtterAccess VIP
Posts: 10,496
Joined: 25-October 10
From: Gulf South USA


...and here is a demo of the label approach I suggested, with Can Shrink as George suggested ...

(Oh, and you should add Can Shrink to the Detail Section of the demo, as tina indicated. That will control the total vertical height.)

HTH
Joe
Attached File(s)
Attached File  LabelCanShrink.zip ( 20.46K )Number of downloads: 0
 

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
wagman
post Apr 15 2020, 11:34 AM
Post#7



Posts: 260
Joined: 12-March 08



Excellent, that works great and I can remove the code I had for hiding those.

Thanks,
Go to the top of the page
 
RJD
post Apr 15 2020, 12:09 PM
Post#8


UtterAccess VIP
Posts: 10,496
Joined: 25-October 10
From: Gulf South USA


thumbup.gif We are all happy to assist.

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th May 2020 - 03:44 PM