Row Height Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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'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.
 
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.
 
Back
Top