Can Grow causes unexpected movement elsewhere

dtm418

New member
Local time
Yesterday, 23:45
Joined
Aug 31, 2006
Messages
5
I have a report that produces cards using the column side by side method.

Severl of the control have cangrow and canshrink = yes it all works fine except I have one field that when it grows it moves an unconnected field down. Let me see if I can draw this: Using .'s as blank space because of this editor

Normal....Normal.....Unexpected
AB..........AB..........AB
CD..........CB..........A
...............D .........CD

Why does text "D" move down because of "A"'s growth? Controls do not touch. Not just "why" but how do I correct?
 
A control with CanGrow == yes will result in the whole line width expanding. That's not unexpected.
 
That is what I thought was happening at first. So I put a border on all my controls with the display as solid. This control that grows only growns downward. None of the controls borders touch another control's borders. As in the example A expanding and moving C down is expected. But A is not expanding in width. Therefore B does not move. However D does. That is what I don't get.
 
Borders overlapping and CanGrow == yes causes problems. Drag all report controls clearly away from one another and then align them with the alignn icons. Doing it by dragging controls are hard to get them visually align. SnapTo grid works great.

Setuping a default form and a default report on the Options menu really helps constructing both type objects. Import those defaults to new mdbs.

I use a custom toolbar with the Align and SnapToGrid icons, among others, on it and always import it to new mdbs. I think that default report grids are 24X24 rasters; making them 20X24 makes control alignment easier because controls are usually made to be hundredths of an inch in width.

sooie pig!
 
I understand what you are suggesting. The problem is these controls should not be aligned. They do not touch each other. There is clearly about four grid points of open space bwtween all of the controls except A and C. So the movement of C is expected and designed for but control D is down and to the right and not touch any other control. After A grows the D moves way down thus creating a huge space between everything which puts it in an untenable position. I hope I am making it clear that A and C touch but B and D stand alone with grid points wisible between them.
 
you say nothing anbout the vertical spacing. Without seeing it in design view, if C is higher than D, C might be growing before D is printed. Make sure they are aligned in the vertical.

Posting a picture and/or the report with some data would help.
 
Unwanted movement through CanGrow

Hey I have a similar problem.
Here's a picture of the label report with 3 sample labels exhibiting different behaviour:
report.jpg


The three main components of the label are the title: txtConcatName (CanGrow = True), the bullet points: txtLabelConcat (also CanGrow = True), which are set to flush up close to the bottom of the title with the following VB code:
Code:
Me.txtLabelConcat.Top = Me.txtConcatName.Top + Me.txtConcatName.Height
and the logo which should remain static. I've put borders around the controls in question to make them easier to troubleshoot.

As you can see, The title field grows appropriately, the bullet points flush to title as required, but the image moves down in relation to the height of the title field.
I've tried setting the Top property of the image with an absolute figure in VB:
Code:
Me.Image11.Top = 1557
but the image (and the price and department fields) move regardless. It's worth noting that they only move in relation to the height of txtConcatName, and the height of txtLabelConcat does not affect them at all.
Here is the form in design view:
reportdesign.jpg
 
Last edited:
I've never run any tests on determining the height when a control is 'grown" but think that it's probably too late at that point to keep all controls aligned.

Try computing the height of each control before the control is generated for printing. Do this on the "on print" event of the appropriate (Detail) section of the report.
 
That was a great idea, and using MsgBox(Me.Image11.Top), I can see that the values are calculated at that point, as the values returned are in line with the displayed position of the box.

However, attempting to set the value of Me.Image11.Height in the OnPrint event (with either an absolute value or a relative one gives an error:
Me.Image11.Top = 1157
errors as : Runtime error 2101 the setting you entered isn't valid for this property

Where as
Me.Image11.Top = Me.txtConcatName.Top + Me.txtConcatName.Height
errors as The expression On Open you entered as the event property setting produced the following error: Method or data member not found
 
Last edited:
OK, I think I've fixed this, though it feels hacky.

After moving some controls around, I noticed that any control which partly overlapped a control set to CanGrow would not move. I therefore expanded the controls so that the very top of them overlapped with the bottom of the txtConcatName control, set their background to transparent, and gave them a large Top Margin (and in the case of the image aligned it to bottom-right).

This will only work for layouts where transparent backgrounds won't adversly affect the design of the report.
 

Users who are viewing this thread

Back
Top Bottom