Can shrink property re sent

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
 
V

Van T. Dinh

Try

Me.LabelName.Visible = False

assuming the code is executed in the context of the Report (so that Me makes
sense.)
 
P

PAOLO

and the field and label underneath would actually move up in the report?

Van T. Dinh said:
Try

Me.LabelName.Visible = False

assuming the code is executed in the context of the Report (so that Me makes
sense.)

--
HTH
Van T. Dinh
MVP (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
 
V

Van T. Dinh

Do you mean that there are other Control(s)??? on the same horizontal line
and you want to "synchronise" the CanShrink of the onther Controls(s) and
simulate the CanShrink of the Label using code?

My guess is that it won't since the code (I assume in the Detail_Format
Event) is executed before the auto-formatting done by Access where the
CanShrink Property is apply. However, you already have the Report set up
and it is easy for you to try it out! That how most of us find out how
things work is Access rather than waiting for someone else to try them out
and advise.

If it won't, you may want to set the Label Height to zero and / or move the
Label Top away so that it will not be on the same horizontal line with the
Other Control(s) and try it out.
 
P

PAOLO

hey I normally do the try and error thing but no I haven't set up the report
yet that's why I was trying to get the info from someone here to set it up
accordingly to what I could do with the can shrink property
 
W

WendyWest

Can't you just click on the report field to bring up the property window,
then select "Can Shrink"?

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
 
W

WendyWest

Sorry, didn't read far enough. If you shrink the text box and hide the label
it still uses the space. You would have a blank spot on the report.

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