S
Stewart Berman
Access 2007
I have a form with a header width a few controls and a details section with
five sub form controls. The resize event of the form with resize and
position the controls so they are fully visible as the user changes the size
of the form window. There appears to be a problem with the detail section.
If the user enlarges the form all is well. The five sub form controls are
positioned and increased in size and they are all visible. Neither the
vertical nor the horizontal scrollbar is visible.
If the user shrinks the from the five sub form controls are positioned and
reduced in size so they are all visible. However the vertical and
horizontal scrollbars appear and if they are slide right or down they expose
the unused portion of the details section which does not automatically
shrink. (Note: I have set the detail section's grow and shrink properties
to yes.)
I then tried to adjust the height of the detail section at the end of the
resize event. This causes at least one of the sub form control's form to be
reloaded. (It might affect all five but the first one throws an error.)
The code that seemed to cause the problem was the last two lines of the
form's Resize event:
Me.Detail.Height = sf_Bottom_Left.Top + sf_Bottom_Left.Height
Me.Width = sf_Top.Width
If I comment out those two lines every thing is fine as long the user either
doesn't change the size of the form's window or one increases it. If the
decrease it I get the scrollbars and the user can scroll into the empty
space of the detail section.
I finally turned off both scrollbar and set a minimum windowheight and
windowwidth via the Resize event.
However, I would like to understand what is going on. Why does changing the
size of the detail section cause the sub form controls' forms to be loaded
again even though they are already loaded?
I also would like to know how to safely resize the detail section in case I
do need to have scrollbars. Right now if I enable the scrollbars and the
user maximizes and then restores the form over half of the scrollbar is
dedicated to empty space.
I have a form with a header width a few controls and a details section with
five sub form controls. The resize event of the form with resize and
position the controls so they are fully visible as the user changes the size
of the form window. There appears to be a problem with the detail section.
If the user enlarges the form all is well. The five sub form controls are
positioned and increased in size and they are all visible. Neither the
vertical nor the horizontal scrollbar is visible.
If the user shrinks the from the five sub form controls are positioned and
reduced in size so they are all visible. However the vertical and
horizontal scrollbars appear and if they are slide right or down they expose
the unused portion of the details section which does not automatically
shrink. (Note: I have set the detail section's grow and shrink properties
to yes.)
I then tried to adjust the height of the detail section at the end of the
resize event. This causes at least one of the sub form control's form to be
reloaded. (It might affect all five but the first one throws an error.)
The code that seemed to cause the problem was the last two lines of the
form's Resize event:
Me.Detail.Height = sf_Bottom_Left.Top + sf_Bottom_Left.Height
Me.Width = sf_Top.Width
If I comment out those two lines every thing is fine as long the user either
doesn't change the size of the form's window or one increases it. If the
decrease it I get the scrollbars and the user can scroll into the empty
space of the detail section.
I finally turned off both scrollbar and set a minimum windowheight and
windowwidth via the Resize event.
However, I would like to understand what is going on. Why does changing the
size of the detail section cause the sub form controls' forms to be loaded
again even though they are already loaded?
I also would like to know how to safely resize the detail section in case I
do need to have scrollbars. Right now if I enable the scrollbars and the
user maximizes and then restores the form over half of the scrollbar is
dedicated to empty space.