Can shrink

F

fredg

Just a quick question what does the can shrink property do in a report ?

It allow the data of records below it to move up so that there is not
blank space between rows. The control must be the only control on that
line. The top of the control placed beneath it must not touch the
bottom of this control.

Example:
Instead of You get
Good Good
Bad Bad
Very Bad
Very Bad
 
P

PAOLO

Thanks Fred

So if you set up the field to "can shrink" and the field is blank will
access hide the label linked to that as well?
 
J

John Vinson

Just a quick question what does the can shrink property do in a report ?

Makes a textbox vanish if it's empty. One common use is in addresses:
say you have textboxes

Addressee
Address1
Address2
City ST Postcode

and one address has nothing in the Address2 field; without Can Shrink
you would see

Joe Doaks
315 Maple Ave

Salem OR 94949

With it, you would see

Joe Doaks
315 Maple Ave
Salem OR 94949


John W. Vinson[MVP]
 
P

PAOLO

What about the label that goes with it?
John Vinson said:
Makes a textbox vanish if it's empty. One common use is in addresses:
say you have textboxes

Addressee
Address1
Address2
City ST Postcode

and one address has nothing in the Address2 field; without Can Shrink
you would see

Joe Doaks
315 Maple Ave

Salem OR 94949

With it, you would see

Joe Doaks
315 Maple Ave
Salem OR 94949


John W. Vinson[MVP]
 
P

PAOLO

So how if I design a report which has labels describing each field and I
want to make invisible the ones that don't have anything typed in (by saying
invisible I mean like can shrink where you can't even see on the report
there was another field set up) is it possible to write a VBA code like

If (IsNull([fieldname])) Then
[labelname]???? canshrink
End If

Something similar to this?

Thanks for your help


Arvin Meyer said:
No, You cannot have anything else visible on the same line.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

PAOLO said:
Thanks Fred

So if you set up the field to "can shrink" and the field is blank will
access hide the label linked to that as well?
report
 
A

Arvin Meyer [MVP]

You can disassociate the label from the textbox then use some code to set
the visible property of the label. If there is nothing else on the line, and
both the textbox and the section are set to CanShrink, the code would look
like this:

Option Compare Database
Option Explicit

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Me.MyField & vbNullString) < 1 Then
Me.Label1.Visible = False
Else
Me.Label1.Visible = True
End If
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

PAOLO said:
So how if I design a report which has labels describing each field and I
want to make invisible the ones that don't have anything typed in (by saying
invisible I mean like can shrink where you can't even see on the report
there was another field set up) is it possible to write a VBA code like

If (IsNull([fieldname])) Then
[labelname]???? canshrink
End If

Something similar to this?

Thanks for your help


Arvin Meyer said:
No, You cannot have anything else visible on the same line.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

report
 
Top