How to change form detail section height?

M

Max Moor

Hi All,

This ought to be simple, but it's stumping me. I have a form (Access
2002) with a form header and footer and detail section. I have a combobox
and label I want to have appear and disappear based on the setting of a
check box. I also want the detail section to shorten up when I hide the
controls.

When hiding the controls, I set their 'Visible' properties to False,
then set their 'Top' properties to 0 to get them out of the area to be
shrunk. Finally, I set the detail section's 'Height' property to a smaller
value. To bring them back, I do things in the reverse order. The detail
section height doesn't change, though.

I've verified that the combobox and label are really out of the way.
I've also checked that I'm not trying to shrink the form into other
controls. I've got CanShrink and CanGrow set for the detail section, but I
didn't think that mattered for this.

The code I use to hide the controls is below. What little rule am I
missing?

Me!lblSession.Visible = False
Me!lblSession.Top = 0
Me!cboSession.Visible = False
Me!cboSession.Top = 0
Me.Section(acDetail).Height = InchesToTwips(2.5) ' 3600 twips

Thanks,
Max
 

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