SubForm Control

M

Michael

Hi Folks - I have a subform control that displays related records.
Typically, there are 1-4 related records per master record. When the subform
has only one record, the subform control displays a lot of "gray space". If
it has two records, it displays a little "gray space". If 3 records, it
looks great. If 4 records, I get a vertical scroll bar.

Is there a way to get the subform control to shrink and grow with the number
of records? Currently, the subform control has Can Grow and Can Shrink set
to yes. Thanks.

Michael
 
D

Duane Hookom

The Can Grow and Can Shrink are only used for printing. You might be able to
adjust and use code like:

Dim intHeightOfOne As Integer
Dim intNumRecords As Integer
intHeightOfOne = 360
intNumRecords = Me.sfrmEmployeesDS.Form.RecordsetClone.RecordCount
MsgBox intNumRecords
Me.sfrmEmployeesDS.Height = intNumRecords * (intHeightOfOne + 2)
 

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