Contracting The Detail section

D

DZ

I want to give the user the ability to expand or contract the detail section
so the user can see more records.

Its a continuous form. I tried using the following to contract the detail ,
but the Detail doesn't contract when I Hide or make a control (that is near
the lower end of the Detail section) invisible.

Controls("txtName").ColumnHidden = True
Controls("txtName").Visible = False
Detail.height = 0

It works only when I set the top property to 0 (zero) (Move it out of the way)

Does anyone know a better way to contract te Detail Section
 
M

Marshall Barton

DZ said:
I want to give the user the ability to expand or contract the detail section
so the user can see more records.

Its a continuous form. I tried using the following to contract the detail ,
but the Detail doesn't contract when I Hide or make a control (that is near
the lower end of the Detail section) invisible.

Controls("txtName").ColumnHidden = True
Controls("txtName").Visible = False
Detail.height = 0

It works only when I set the top property to 0 (zero) (Move it out of the way)


The ColumnHidden property is only effective in datasheet
view so get rid of that line.

A section can not me made smaller than the controls in the
section so setting its Top to 0 is the right way to get
ready to shrink the section.

If you want to make the section as small as possible, then
setting its Height to 0 will shrink it to the bottom of the
lowest control.

The typical code would be something like:

Me.textname.Top = 0
Me.textname.Visible = False
Me.Detail.height = 0
Me,Detail.height = Me.Detail.height + 100 ' a little margin
 

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