Dynamic Subform Heights

  • Thread starter Thread starter tobesurveyor via AccessMonster.com
  • Start date Start date
T

tobesurveyor via AccessMonster.com

Good Morning All-
I am trying to make a form look and feel like Outlook 2003's Today Page. I
am focusing on the calendar portion of the page where it displays events
happening for the next several days. As more events are added to any day,
that portion on the Today form expands, and the remainder days move down to
allow everything to be seen.


I have come up with the basic form design. On a form I have three subforms.
I have text labels that act as the dates for each day. Everything works
great. Now for the question.

I now want to program the portion where the subforms are dynamic in the sense
that they expand and move down if there is a lot of data to view for one day.
One way I can do this is on an On_Open event of the main form, do a record
count based upon each query, and based upon the number of records, resize the
subforms accordingly and move the remainder subforms to a new position on the
screen. Is this the best approach?

Thank you in advance.
Chris
 
tobesurveyor said:
I am trying to make a form look and feel like Outlook 2003's Today Page. I
am focusing on the calendar portion of the page where it displays events
happening for the next several days. As more events are added to any day,
that portion on the Today form expands, and the remainder days move down to
allow everything to be seen.

I have come up with the basic form design. On a form I have three subforms.
I have text labels that act as the dates for each day. Everything works
great. Now for the question.

I now want to program the portion where the subforms are dynamic in the sense
that they expand and move down if there is a lot of data to view for one day.
One way I can do this is on an On_Open event of the main form, do a record
count based upon each query, and based upon the number of records, resize the
subforms accordingly and move the remainder subforms to a new position on the
screen. Is this the best approach?


You can use your calculated values to determine how high the
form needs to be to display all the subform. If you are
making the form taller, then first set the form's
InsideHeight property so the form is tall enough to contain
the subforms, then set each subform control's Height and Top
properties. If you're making the form shorter, deal with
the controls before setting the form's InsideHeight. Note
that the form's detail section is whatever space is left
after the header and footer sections are displayed.
 
Back
Top