By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

How to set Datasheet RowHeight with VBA?

P: n/a
I can set the ColumnWidth property of a datasheet in VBA like this:

Forms("frm0").Controls(strForm).Form.Controls(strC tl).ColumnWidth = intCw

But when I try to set the RowHeight like this:

Forms("frm0").Controls(strForm).Form.Controls(strC tl).ColumnWidth = lngRh

I get Error Number 438: Object doesn't support this property or method

I've tried it without the variables:

Forms!frm0!frm0_datasheet.Form![Documents].RowHeight = 200

Still no luck...

Am I missing something? Any suggestions welcome.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"deko" <ww*******************************@nospam.com> wrote in message news:<aJ*******************@newssvr27.news.prodigy .com>...
I can set the ColumnWidth property of a datasheet in VBA like this:

Forms("frm0").Controls(strForm).Form.Controls(strC tl).ColumnWidth = intCw

But when I try to set the RowHeight like this:

Forms("frm0").Controls(strForm).Form.Controls(strC tl).ColumnWidth = lngRh

I get Error Number 438: Object doesn't support this property or method

I've tried it without the variables:

Forms!frm0!frm0_datasheet.Form![Documents].RowHeight = 200

Still no luck...

Am I missing something? Any suggestions welcome.

So close! The rowheight prop applies to the form object, not
individual controls. Try

Forms("frm0").Rowheight = 200

or

Me.Rowheight = 200

in the load event of your form.

Bruce
Nov 13 '05 #2

P: n/a
> So close! The rowheight prop applies to the form object, not
individual controls. Try

Forms("frm0").Rowheight = 200

or

Me.Rowheight = 200


That did the trick - thanks. Controlling datasheet row and column size has
always been a pain for me. But I think I've got a handle on it now...
seems weird that column width and row height do not belong to the same
object.
Nov 13 '05 #3

P: n/a
"deko" <ww*******************************@nospam.com> wrote in message news:<1E*******************@newssvr27.news.prodigy .com>...
That did the trick - thanks. Controlling datasheet row and column size has
always been a pain for me. But I think I've got a handle on it now...
seems weird that column width and row height do not belong to the same
object.


If you think about what you can control in datasheet view, you see
that you can adjust individual column widths (by dragging an edge or
right-clicking a column header and entering a specific width) so it
makes sense that ColumnWidth applies to a particular control.
However, when you try to adjust the height of a row in datasheet view,
it adjusts the height of *all* of the controls on the form, i.e., you
cannot adjust them individually. Thus it makes sense that the
RowHeight property applies to the form and not an individual control.
If I think about it in these terms it makes sense to me.

HTH,
Bruce
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.