Changing subform properties on form open

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

Guest

This is probably simple, but I can't seem to get the syntax right.

I have a form called "frm_customer" with a subform called "subfrm_comments".

when the form "frm_customer" opens, I have some code for the On_Open
property that makes some changes based on user. I check the users screen
resolution and want to change the height of the subform based on users
resolution. I have all the code in place for checking resolution, just need
the syntax for changing the subform height.

I tried me.subfrm_comments.height = 3.0, but this doesn't work.

Any advice on correct syntax for referencing subform control?
 
Luke

Programmaticaly the heights and widths are based on TWIPS ie 1 cm = 567
Twips

I resize subforms and some controls on the forms Resize event eg:-

Private Sub Form_Resize()

If Me.InsideHeight > (Me.FormHeader.Height + Me.FormFooter.Height + 0.1
* 567) Then
Me.tvwPAU.Height = Me.InsideHeight - (Me.FormHeader.Height +
Me.FormFooter.Height + 0.1 * 567)
End If
Me.tvwPAU.Width = Me.InsideWidth + 0.05 * 567

End Sub

This means that as a user maximises or resizes a form, the control and/or
subform would size accordingly...

Of course this is just an example and you will need to modify it to suit
your particular case.

cheers'
Jeff
 
Thanks for the reponse. It's actually not exactly what I was looking for
though - may have not been really clear in my original post. I am looking
for the syntax on how to modify the height of the subform from the ON-OPEN
sub of the main form.

Private Sub Form_Open(Cancel As Integer) {this is the main form}

'trying to modify the subform height based on users res
'IsUserLowRes module returning true/false based on users resolution

If IsUserLowRes() = true then
me.subfrm_comments.height = 3.0
else
me.subfrm_comments.height = 6.0
end if

End sub

I tried the above, but not sure of the syntax on how to reference the
subform conrol.
 
Never mind. Figured it out. I actually had the syntax right, just had a typo!

Thanks for looking!
 
Back
Top