Row Height Question

D

Don

I have a main form that has a datasheet form as a sub form. I want to set
the row height on my datasheet. The code that I write, halts and will not
execute. I have written it in the on-open property of my main form. Below
is an example of the code I wrote. Can someone tell me what I have done
wrong?

[Forms]![frmMAIN_FORM]![frmSUB_FORM].SetFocus
[Forms]![frmMAIN_FORM]![frmSUB_FORM].RowHeight = 250
 
S

Sirocco

I'm not sure if the rowheight of a subform can be defined directly - in all
my subforms I set the typesize to control the row height.
 
D

Dirk Goldgar

Don said:
I have a main form that has a datasheet form as a sub form. I want
to set the row height on my datasheet. The code that I write, halts
and will not execute. I have written it in the on-open property of
my main form. Below is an example of the code I wrote. Can someone
tell me what I have done wrong?

[Forms]![frmMAIN_FORM]![frmSUB_FORM].SetFocus
[Forms]![frmMAIN_FORM]![frmSUB_FORM].RowHeight = 250

I think your main problem is that you're leaving out the necessary
qualifier for the Form property of the subform control. You also should
not need to set the focus to the subform (unless you have some other
reason to do so), and you can use the Me keyword to stand in for the
reference to the main form, since this code is executing on that form.
So try this:

Me![frmSUB_FORM].Form.RowHeight = 250

Note that "frmSUB_FORM" must be the name of the subform control (on the
main form), which may or may not be the same as the name of the form
object that the subform control will display.
 

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