> I'm trying to size a subform control to display all of the records (thus
> eliminating the vertical scroll bar). I know that the CanGrow property is
[quoted text clipped - 19 lines]
> Thanks To All,
> Fred Zuckerman
It's crazy, but it's returning -1 because it is set to the default
value of 240 twips. Why it doesn't return 240, I don't know. But if
you set it to 240 (or some other value) yourself then RowHeight will
return the value you set, e.g.
Mreccount = Me.Child5.Form.RecordsetClone.RecordCount
Me.Child5.Form.RowHeight = 240
Mrowheight = Me.Child5.Form.RowHeight ''' <--this will now return 240
Msubfrmheight = (Mreccount + 2) * Mrowheight
Me.Child5.Height = Msubfrmheight
Conversely, setting the RowHeight to -1 will restore the default value
of 240.
Bruce
> I'm trying to size a subform control to display all of the records
> (thus eliminating the vertical scroll bar). I know that the CanGrow
[quoted text clipped - 19 lines]
> Thanks To All,
> Fred Zuckerman
According to the Help file -1 is the value that corresponds to setting the
RowHeight to its default hieght for the current font.
Instead of worrying about "getting" the RowHeight, just go ahead and set it.
It will take some trial and error, but otherwise should work.
This also only applies to datasheet view. Is that the view that your
subform uses?

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Fred Zuckerman - 03 May 2008 00:41 GMT
>> I'm trying to size a subform control to display all of the records
>> (thus eliminating the vertical scroll bar). I know that the CanGrow
[quoted text clipped - 28 lines]
> This also only applies to datasheet view. Is that the view that your
> subform uses?
Yes, the subform is in datasheet view.
A previous reply from Bruce told me that the default value is 240 twips. So,
like you and he recommend, I'll just set the RowHeight to 240, then the code
should work fine.
Thank You Very Much,
Fred