Resize form with footer

C

CJ

Hi Groupies!

I have fields in my form footer that do not always need to be completed. I
have added the code
Me.FormFooter.Visible = False
in the form OnLoad event and Current event and where ever necessary.

When the user selects the right option in the detail section, I would like
the footer to become visible
so that the appropriate fields are available. I have added
Me.FormFooter.Visible = True
where appropriate.

My problem is that when the form footer becomes visible, it does not resize
the form to show all of the detail as well as the footer. The footer goes on
top of the lower part of the detail section and covers most of it up. The
form is not full screen and I have saved it as the size that would fit with
the footer.

I know that I could make the footer visible and just use Enable and Locked
for all of the controls but I was hoping that I could use Visible because it
is easier to write.

Any ideas?
 
J

Jack Leach

Try changing the Section height of the form...

Me.Section("Footer").Height = #ofTwips

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
C

CJ

Hi Jack, thanks for popping in.

I tried your suggestion for all three sections of my form.

Me.FormFooter.Visible = True
Me.FormFooter.Height = 2790
Me.Detail.Height = 54458.976
Me.FormHeader.Height = 644.976

No such luck. It still overlaps exactly the same.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
Jack Leach said:
Try changing the Section height of the form...

Me.Section("Footer").Height = #ofTwips

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
J

Jeff Boyce

Here's a vote for using .Enabled = False instead of .Visible = False ...

Many users find it disconcerting to have elements popping into and out of
existance.

If you include a disabled Footer, your user's get the message that there is
something else, but not in their present circumstances.

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Office/Access MVP


CJ said:
Hi Jack, thanks for popping in.

I tried your suggestion for all three sections of my form.

Me.FormFooter.Visible = True
Me.FormFooter.Height = 2790
Me.Detail.Height = 54458.976
Me.FormHeader.Height = 644.976

No such luck. It still overlaps exactly the same.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
Jack Leach said:
Try changing the Section height of the form...

Me.Section("Footer").Height = #ofTwips

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
C

CJ

That's a good point Jeff and the reason why I usually use Enabled.
In this case it is a whole section so I thought I would go for
something different but I don't feel like goofing around with
this for hours when I don't really NEED it.

Sometimes it good to stick with what you know!

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
Jeff Boyce said:
Here's a vote for using .Enabled = False instead of .Visible = False ...

Many users find it disconcerting to have elements popping into and out of
existance.

If you include a disabled Footer, your user's get the message that there
is something else, but not in their present circumstances.

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jack Leach

Did you by chance try the Section("itemname") format? For whatever reason,
I've had better luck with this in the past (though my usage was between the
Header and Detail sections rather than the Footer).

I'm not positive that the properties will take a less-than-whole number
either, though I wouldn't think it make a difference. Still, you might try
rounding them... one twip one way or the other can't make all that much of a
difference.

You might try a Repaint on the form, though I don't recall ever needing to
do this when working with the header.

This really should work... I've done it before. If I thought I might be
able to find the project I'd look it up but it was one that didn't end up
sticking around.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



CJ said:
Hi Jack, thanks for popping in.

I tried your suggestion for all three sections of my form.

Me.FormFooter.Visible = True
Me.FormFooter.Height = 2790
Me.Detail.Height = 54458.976
Me.FormHeader.Height = 644.976

No such luck. It still overlaps exactly the same.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
Jack Leach said:
Try changing the Section height of the form...

Me.Section("Footer").Height = #ofTwips

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
C

CJ

No worries.

Thanks Jack

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
Jack Leach said:
Did you by chance try the Section("itemname") format? For whatever
reason,
I've had better luck with this in the past (though my usage was between
the
Header and Detail sections rather than the Footer).

I'm not positive that the properties will take a less-than-whole number
either, though I wouldn't think it make a difference. Still, you might
try
rounding them... one twip one way or the other can't make all that much of
a
difference.

You might try a Repaint on the form, though I don't recall ever needing to
do this when working with the header.

This really should work... I've done it before. If I thought I might be
able to find the project I'd look it up but it was one that didn't end up
sticking around.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



CJ said:
Hi Jack, thanks for popping in.

I tried your suggestion for all three sections of my form.

Me.FormFooter.Visible = True
Me.FormFooter.Height = 2790
Me.Detail.Height = 54458.976
Me.FormHeader.Height = 644.976

No such luck. It still overlaps exactly the same.
 
K

Krzysztof Naworyta

You have 2 options:

1)
Private Sub Command1_Click()
With Me.Section(2)
.Visible = Not .Visible
End With
On Error Resume Next 'if maximized...
DoCmd.RunCommand acCmdSizeToFitForm
End Sub

or

2)
Private Sub Command2_Click()
With Me.Section(2)
.Visible = Not .Visible
Me.InsideHeight = Me.Section(0).Height - .Height * .Visible
End With
End Sub

--
KN

Juzer CJ <[email protected]> napisa³
| Hi Groupies!
|
| I have fields in my form footer that do not always need to be
| completed. I have added the code
| Me.FormFooter.Visible = False
| in the form OnLoad event and Current event and where ever necessary.
|
| When the user selects the right option in the detail section, I would
| like the footer to become visible
| so that the appropriate fields are available. I have added
| Me.FormFooter.Visible = True
| where appropriate.
|
| My problem is that when the form footer becomes visible, it does not
| resize the form to show all of the detail as well as the footer. The
| footer goes on top of the lower part of the detail section and covers
| most of it up. The form is not full screen and I have saved it as the
| size that would fit with the footer.
|
| I know that I could make the footer visible and just use Enable and
| Locked for all of the controls but I was hoping that I could use
| Visible because it is easier to write.
|
| Any ideas?
 
D

Dale Fye

I agree with Krzysztof, use the forms InsideHeight property to change the
height of the form.

me.insideheight = me.insideheight + me.section(acFooter).height
 

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