Can Shrink and Can Grow Questions

B

bw

I'm not sure I understand what happens when one sets the controls, and the
Section Header Can Grow and Can Shrink properties to Yes.

Example Report
Control 1 Here

Control 2 Here (when control 2 has data, control 3 will have data)
Control 3 Here

Control 4 Here (when control 4 has data, control 5 will have data)
Control 5 here

Control 6 Here

Control 7 Here

This is the way my report looks when all controls have data.

As an example of what I'm trying to understand, I want to know where Control
7 will appear if Controls 2,3,4,5 and 6 are all null (wouldn't it take the
place of Control 2 on the report?)

How does Control 7 move up (and to where) as the other control values become
null?
What happens to the spacing I have set between Controls (like between
Control 1 and Control 2?)

Thanks,
Bernie
 
M

Marshall Barton

bw said:
I'm not sure I understand what happens when one sets the controls, and the
Section Header Can Grow and Can Shrink properties to Yes.

Example Report
Control 1 Here

Control 2 Here (when control 2 has data, control 3 will have data)
Control 3 Here

Control 4 Here (when control 4 has data, control 5 will have data)
Control 5 here

Control 6 Here

Control 7 Here

This is the way my report looks when all controls have data.

As an example of what I'm trying to understand, I want to know where Control
7 will appear if Controls 2,3,4,5 and 6 are all null (wouldn't it take the
place of Control 2 on the report?)

How does Control 7 move up (and to where) as the other control values become
null?
What happens to the spacing I have set between Controls (like between
Control 1 and Control 2?)


The spacing between controls remains regardless of shrinking
controls. So control 7 would move up by the amount of space
reclaimed from the Null controls, but all the spacing
between controls would still be there.

A logical exception to controls "moving up" is if there are
other nonshrinking controls to the left or right of the
shrinking controls. Another complication is that if the
bottom of a shrinking control partially overlaps the top of
another control, the other control can not "move up".

Does that help your understanding?
 
B

bw

Marshall Barton said:
The spacing between controls remains regardless of shrinking
controls. So control 7 would move up by the amount of space
reclaimed from the Null controls, but all the spacing
between controls would still be there.

A logical exception to controls "moving up" is if there are
other nonshrinking controls to the left or right of the
shrinking controls. Another complication is that if the
bottom of a shrinking control partially overlaps the top of
another control, the other control can not "move up".

Does that help your understanding?

Yes it does! I guess I have a problem elsewhere, but I can't seem to locate
what the problem might be.

I have checked carefully, and I have no controls that touch or share the
same space with other controls.
I'm glad you confirmed that controls move up in order, to replace those Null
controls.

I have aligned all controls to the left and spaced them equally (visible
spaces), but I still have the same problem, which is: the Controls don't
move up all the way.

Assume all controls before the one in question are null (Control 1 is never
null).
Example1: Control 4 should move up to fill the space of Control 2. It only
moves up to fill the Control 3 position.
Example2: Control 6 should move up to fill the space of Control 2. It only
moves up to fill the Control 4 position.
Example3: Control 7 should move up to fill the space of Control 2...AND IT
DOES!

Do you have a suggestion as to what may be wrong with my controls?

Thanks for your help...
Bernie
 
D

Damian S

Hi bw,

Remember to set the can shrink value of the actual section your control is
in to YES.

But the point is that if you have controls with white space between them,
that white space will remain even if the controls shrink... so your "equally
spaced" controls will go, but the equivalent amount of white space between
them will remain.

Hope this helps.

Damian.
 
B

bw

Yes Damian, this helped big time.

When I remove all my white space between the controls, everything moves
up...to where it should.

I haven't tried it yet, but now I'm going to include in my controls Chr(10)
and Chr(13) where appropriate to provide the white spaces that I want
between the controls.

I hope this is the proper way to do this.

Bernie
 
D

Duane Hookom

Try display the border of all controls so you can more easily troubleshoot
your report. If your control value is actually null and it is set to Can
Shrink then it should disappear.
 
B

bw

Another great suggestion!

I did display the border of all the controls, and I see that Damian is
correct. The white space I had between controls remains as the controls
move up.

So now the question is, how do I program in the proper amount of white space
within the control itself?
For example, if the control source for the control is: =[Control 2], I would
think I could do something like
=Chr(10) & [Control 2]
This does in fact put a new line within the control, but the new line has a
box (a character) when the value of the control is displayed on the report.
The value of the control in this case displays as follows (where x is a
box):
x
This is the data

Why is the x (box character) showing?

Bernie


Duane Hookom said:
Try display the border of all controls so you can more easily troubleshoot
your report. If your control value is actually null and it is set to Can
Shrink then it should disappear.

--
Duane Hookom
MS Access MVP

Damian S said:
Hi bw,

Remember to set the can shrink value of the actual section your control
is
in to YES.

But the point is that if you have controls with white space between them,
that white space will remain even if the controls shrink... so your
"equally
spaced" controls will go, but the equivalent amount of white space
between
them will remain.

Hope this helps.

Damian.

bw said:
bw wrote:

I'm not sure I understand what happens when one sets the controls, and
the
Section Header Can Grow and Can Shrink properties to Yes.

Example Report
Control 1 Here

Control 2 Here (when control 2 has data, control 3 will have
data)
Control 3 Here

Control 4 Here (when control 4 has data, control 5 will have
data)
Control 5 here

Control 6 Here

Control 7 Here

This is the way my report looks when all controls have data.

As an example of what I'm trying to understand, I want to know where
Control
7 will appear if Controls 2,3,4,5 and 6 are all null (wouldn't it take
the
place of Control 2 on the report?)

How does Control 7 move up (and to where) as the other control values
become
null?
What happens to the spacing I have set between Controls (like between
Control 1 and Control 2?)


The spacing between controls remains regardless of shrinking
controls. So control 7 would move up by the amount of space
reclaimed from the Null controls, but all the spacing
between controls would still be there.

A logical exception to controls "moving up" is if there are
other nonshrinking controls to the left or right of the
shrinking controls. Another complication is that if the
bottom of a shrinking control partially overlaps the top of
another control, the other control can not "move up".

Does that help your understanding?

--
Marsh
MVP [MS Access]

Yes it does! I guess I have a problem elsewhere, but I can't seem to
locate
what the problem might be.

I have checked carefully, and I have no controls that touch or share the
same space with other controls.
I'm glad you confirmed that controls move up in order, to replace those
Null
controls.

I have aligned all controls to the left and spaced them equally (visible
spaces), but I still have the same problem, which is: the Controls
don't
move up all the way.

Assume all controls before the one in question are null (Control 1 is
never
null).
Example1: Control 4 should move up to fill the space of Control 2. It
only
moves up to fill the Control 3 position.
Example2: Control 6 should move up to fill the space of Control 2. It
only
moves up to fill the Control 4 position.
Example3: Control 7 should move up to fill the space of Control 2...AND
IT
DOES!

Do you have a suggestion as to what may be wrong with my controls?

Thanks for your help...
Bernie
 
D

Duane Hookom

If you want a control that "wraps" your field value to the second line in a
text box, you can use a control source like:
=Chr(13) + Chr(10) + [FieldName]
If [FieldName] is Null then the box can shrink.


--
Duane Hookom
MS Access MVP


bw said:
Another great suggestion!

I did display the border of all the controls, and I see that Damian is
correct. The white space I had between controls remains as the controls
move up.

So now the question is, how do I program in the proper amount of white
space within the control itself?
For example, if the control source for the control is: =[Control 2], I
would think I could do something like
=Chr(10) & [Control 2]
This does in fact put a new line within the control, but the new line has
a box (a character) when the value of the control is displayed on the
report.
The value of the control in this case displays as follows (where x is a
box):
x
This is the data

Why is the x (box character) showing?

Bernie


Duane Hookom said:
Try display the border of all controls so you can more easily
troubleshoot your report. If your control value is actually null and it
is set to Can Shrink then it should disappear.

--
Duane Hookom
MS Access MVP

Damian S said:
Hi bw,

Remember to set the can shrink value of the actual section your control
is
in to YES.

But the point is that if you have controls with white space between
them,
that white space will remain even if the controls shrink... so your
"equally
spaced" controls will go, but the equivalent amount of white space
between
them will remain.

Hope this helps.

Damian.

:


bw wrote:

I'm not sure I understand what happens when one sets the controls,
and the
Section Header Can Grow and Can Shrink properties to Yes.

Example Report
Control 1 Here

Control 2 Here (when control 2 has data, control 3 will have
data)
Control 3 Here

Control 4 Here (when control 4 has data, control 5 will have
data)
Control 5 here

Control 6 Here

Control 7 Here

This is the way my report looks when all controls have data.

As an example of what I'm trying to understand, I want to know where
Control
7 will appear if Controls 2,3,4,5 and 6 are all null (wouldn't it
take the
place of Control 2 on the report?)

How does Control 7 move up (and to where) as the other control values
become
null?
What happens to the spacing I have set between Controls (like between
Control 1 and Control 2?)


The spacing between controls remains regardless of shrinking
controls. So control 7 would move up by the amount of space
reclaimed from the Null controls, but all the spacing
between controls would still be there.

A logical exception to controls "moving up" is if there are
other nonshrinking controls to the left or right of the
shrinking controls. Another complication is that if the
bottom of a shrinking control partially overlaps the top of
another control, the other control can not "move up".

Does that help your understanding?

--
Marsh
MVP [MS Access]

Yes it does! I guess I have a problem elsewhere, but I can't seem to
locate
what the problem might be.

I have checked carefully, and I have no controls that touch or share
the
same space with other controls.
I'm glad you confirmed that controls move up in order, to replace those
Null
controls.

I have aligned all controls to the left and spaced them equally
(visible
spaces), but I still have the same problem, which is: the Controls
don't
move up all the way.

Assume all controls before the one in question are null (Control 1 is
never
null).
Example1: Control 4 should move up to fill the space of Control 2. It
only
moves up to fill the Control 3 position.
Example2: Control 6 should move up to fill the space of Control 2. It
only
moves up to fill the Control 4 position.
Example3: Control 7 should move up to fill the space of Control 2...AND
IT
DOES!

Do you have a suggestion as to what may be wrong with my controls?

Thanks for your help...
Bernie
 
B

bw

I've got it!!!!!

I must have been miscommunication my problem, because you guys didn't seem
to understand what I was looking for.
So for the interest of others, I'll try to restate, then provide the
solution.
I want to control how much white space is between controls on a section of
my report. The section header and all controls have Can Shrink set to
"Yes".

First, place all controls as close as possible to each other, vertically.
Then set the Bottom Margin Property to a set value (in my case .2")

So in my original example
Control Name Bottom Margin
Control 1 .2"
Control 2 0"
Control 3 .2"
Control 4 0"
Control 5 .2
Control 6 .2

That's it! How beautiful the report looks! I'm so happy about this.
Thanks for your help.

Bernie

Duane Hookom said:
If you want a control that "wraps" your field value to the second line in
a text box, you can use a control source like:
=Chr(13) + Chr(10) + [FieldName]
If [FieldName] is Null then the box can shrink.


--
Duane Hookom
MS Access MVP


bw said:
Another great suggestion!

I did display the border of all the controls, and I see that Damian is
correct. The white space I had between controls remains as the controls
move up.

So now the question is, how do I program in the proper amount of white
space within the control itself?
For example, if the control source for the control is: =[Control 2], I
would think I could do something like
=Chr(10) & [Control 2]
This does in fact put a new line within the control, but the new line has
a box (a character) when the value of the control is displayed on the
report.
The value of the control in this case displays as follows (where x is a
box):
x
This is the data

Why is the x (box character) showing?

Bernie


Duane Hookom said:
Try display the border of all controls so you can more easily
troubleshoot your report. If your control value is actually null and it
is set to Can Shrink then it should disappear.

--
Duane Hookom
MS Access MVP

Hi bw,

Remember to set the can shrink value of the actual section your control
is
in to YES.

But the point is that if you have controls with white space between
them,
that white space will remain even if the controls shrink... so your
"equally
spaced" controls will go, but the equivalent amount of white space
between
them will remain.

Hope this helps.

Damian.

:


bw wrote:

I'm not sure I understand what happens when one sets the controls,
and the
Section Header Can Grow and Can Shrink properties to Yes.

Example Report
Control 1 Here

Control 2 Here (when control 2 has data, control 3 will have
data)
Control 3 Here

Control 4 Here (when control 4 has data, control 5 will have
data)
Control 5 here

Control 6 Here

Control 7 Here

This is the way my report looks when all controls have data.

As an example of what I'm trying to understand, I want to know where
Control
7 will appear if Controls 2,3,4,5 and 6 are all null (wouldn't it
take the
place of Control 2 on the report?)

How does Control 7 move up (and to where) as the other control
values
become
null?
What happens to the spacing I have set between Controls (like
between
Control 1 and Control 2?)


The spacing between controls remains regardless of shrinking
controls. So control 7 would move up by the amount of space
reclaimed from the Null controls, but all the spacing
between controls would still be there.

A logical exception to controls "moving up" is if there are
other nonshrinking controls to the left or right of the
shrinking controls. Another complication is that if the
bottom of a shrinking control partially overlaps the top of
another control, the other control can not "move up".

Does that help your understanding?

--
Marsh
MVP [MS Access]

Yes it does! I guess I have a problem elsewhere, but I can't seem to
locate
what the problem might be.

I have checked carefully, and I have no controls that touch or share
the
same space with other controls.
I'm glad you confirmed that controls move up in order, to replace
those Null
controls.

I have aligned all controls to the left and spaced them equally
(visible
spaces), but I still have the same problem, which is: the Controls
don't
move up all the way.

Assume all controls before the one in question are null (Control 1 is
never
null).
Example1: Control 4 should move up to fill the space of Control 2. It
only
moves up to fill the Control 3 position.
Example2: Control 6 should move up to fill the space of Control 2. It
only
moves up to fill the Control 4 position.
Example3: Control 7 should move up to fill the space of Control
2...AND IT
DOES!

Do you have a suggestion as to what may be wrong with my controls?

Thanks for your help...
Bernie
 
M

Marshall Barton

If you need finer control over the space between shrinking
text boxes than you can get by adding newlines, try this
somewhat convoluted idea. Create a text box (named
txtSpace2) with attached lable and set the Height property
of both the text box and the label to the amount of space
you want between the existing shrinking controls. Leave
the text box's control source empty and set it's CanShrink
property to Yes. Set the label's Caption to a space
character. Then position them exactly above your control2
and below the control1. This should occupy all the vertical
space between control1 and control2.

Since the text box has no control source, it will shrink.
However, since labels can shrink, the desired amount of
space will remain. The trick to this goofy approach is that
an invisible text box's label will also be invisible so the
space will shrink when you make the text box invisible.
This is accomplished with a line of code in the section's
Format event:
Me.txtSpace2.Visible = Not IsNull(Me.control2)

Repeat the above arrangement with a txtSpace3 and its
attached label above your control3, etc.
 
M

Marshall Barton

bw said:
I've got it!!!!!

I must have been miscommunication my problem, because you guys didn't seem
to understand what I was looking for.
So for the interest of others, I'll try to restate, then provide the
solution.
I want to control how much white space is between controls on a section of
my report. The section header and all controls have Can Shrink set to
"Yes".

First, place all controls as close as possible to each other, vertically.
Then set the Bottom Margin Property to a set value (in my case .2")

So in my original example
Control Name Bottom Margin
Control 1 .2"
Control 2 0"
Control 3 .2"
Control 4 0"
Control 5 .2
Control 6 .2

That's it! How beautiful the report looks! I'm so happy about this.


Thanks for posting your final solution. I never thought of
the margin properties in this kind of situation. This is
much nicer than what I had been doing before there were any
such thing as margin properties,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top