Readjust Form Dimensions

D

Don

I have a form with a footer that is not visibile when the form is opened.
The only time the footer should be visible is when the user clicks a button
to add on the form to make the footer visible where a textbox is also hidden.

My problem is this: when the footer becomes visible, it doesn't add to the
bottom of my form, it hides the bottom of my form by opening on top of my
existing form. How can I have the footer open as a continuation to the
bottom of my form instead of opening on top of it?
 
G

Graham Mandeno

Hi Don

After making the footer visible (or invisible) adjust the InsideHeight of
the form to include (or exclude) the height of the footer:

Me.InsideHeight = Me.Section(acHeader).Height
+ Me.Section(acDetail).Height _
+ IIf(Me.Section(acFooter).Visible, Me.Section(acFooter).Height, 0)
 
D

Don

Thank you for your suggestion; however, when I invoke the code, the length of
my form is now 10 times the original length as opposed to the 1/2 inch I was
looking for. Can you give me just a bit more advice?
--
Don Rountree


Graham Mandeno said:
Hi Don

After making the footer visible (or invisible) adjust the InsideHeight of
the form to include (or exclude) the height of the footer:

Me.InsideHeight = Me.Section(acHeader).Height
+ Me.Section(acDetail).Height _
+ IIf(Me.Section(acFooter).Visible, Me.Section(acFooter).Height, 0)

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Don said:
I have a form with a footer that is not visibile when the form is opened.
The only time the footer should be visible is when the user clicks a
button
to add on the form to make the footer visible where a textbox is also
hidden.

My problem is this: when the footer becomes visible, it doesn't add to the
bottom of my form, it hides the bottom of my form by opening on top of my
existing form. How can I have the footer open as a continuation to the
bottom of my form instead of opening on top of it?
 
G

Graham Mandeno

Hi Don

That's very strange! Are you sure that your detail section isn't a whole
lot longer than it needs to be? Or your header section perhaps?

All this code is doing is to set the height of the form window
(InsideHeight) to be the same as the sum of the heights of the visible
sections.

It assumes that (a) your form is single-view and not continuous and (b) the
header is always visible. If the visibility of the header varies also, then
add another check for that into the expression:

Me.InsideHeight = _
IIf(Me.Section(acHeader).Visible, Me.Section(acHeader).Height, 0)
+ Me.Section(acDetail).Height _
+ IIf(Me.Section(acFooter).Visible, Me.Section(acFooter).Height, 0)

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand


Don said:
Thank you for your suggestion; however, when I invoke the code, the length
of
my form is now 10 times the original length as opposed to the 1/2 inch I
was
looking for. Can you give me just a bit more advice?
--
Don Rountree


Graham Mandeno said:
Hi Don

After making the footer visible (or invisible) adjust the InsideHeight of
the form to include (or exclude) the height of the footer:

Me.InsideHeight = Me.Section(acHeader).Height
+ Me.Section(acDetail).Height _
+ IIf(Me.Section(acFooter).Visible, Me.Section(acFooter).Height, 0)

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Don said:
I have a form with a footer that is not visibile when the form is
opened.
The only time the footer should be visible is when the user clicks a
button
to add on the form to make the footer visible where a textbox is also
hidden.

My problem is this: when the footer becomes visible, it doesn't add to
the
bottom of my form, it hides the bottom of my form by opening on top of
my
existing form. How can I have the footer open as a continuation to the
bottom of my form instead of opening on top of it?
 

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