Hi all,
Please tell me if anyone of you has an idea of how object's HEIGHT property
is different from the TOP in terms of scaling or units of measure? What I am
trying to accomplish is like getting 2 subforms resized to fit screen but at
the same time keep lower object's height unchanged:
Before:
+-------------------+
| |
+-------------------+
| |
+-------------------+
After:
+-------------------+
| |
| |
| |
+-------------------+
| |
+-------------------+
Sub Form_Open '--- Just to resize height
DoCmd.Maximize
Me.object1.Height = Me.WindowHeight - me.object2.height - 50
Me.object2.Top = Me.object1.Top + Me.object1.Height + 50
End Sub
Running this code generates run-time error 2100 (The control or subform is
too large for this location).
Who's got a clue for this?....
Eugene - 11 May 2007 14:38 GMT
Maybe this will look better:
Before:
+-------------------+
| |
+-------------------+
| |
+-------------------+
After:
+-------------------+
| |
| |
| |
+-------------------+
| |
+-------------------+
>Hi all,
>
[quoted text clipped - 29 lines]
>
>Who's got a clue for this?....
Damon Heron - 11 May 2007 16:42 GMT
How about this - use a variable to assign the twips calculation then make
the top property = to the variable:
Dim x As Integer
DoCmd.Maximize
Me.subform1.Height = Me.WindowHeight - (Me.subform2.Height - 50)
x = Me.subform1.top + (Me.subform1.Height + 50)
Debug.Print x
Me.subform2.top = x
HTH
Damon
> Hi all,
>
[quoted text clipped - 5 lines]
> at
> the same time keep lower object's height unchanged:
Damon Heron - 11 May 2007 17:11 GMT
Yah, I spoke too soon. If you step thru the code then it works, but not at
run time. Marshall is right about the inside height property, or you could
just assign a variable to that calculation: Me.subform1.Height = y -
(Me.subform2.Height - 50)
Damon
> How about this - use a variable to assign the twips calculation then make
> the top property = to the variable:
[quoted text clipped - 18 lines]
>> at
>> the same time keep lower object's height unchanged:
Marshall Barton - 11 May 2007 16:53 GMT
>Please tell me if anyone of you has an idea of how object's HEIGHT property
>is different from the TOP in terms of scaling or units of measure? What I am
[quoted text clipped - 25 lines]
>Running this code generates run-time error 2100 (The control or subform is
>too large for this location).
Use the InsideHeight property instead of WindowHeight.
WindowHeight includes the form's border, title bar, scroll
bars, etc.

Signature
Marsh
MVP [MS Access]
Eugene - 12 May 2007 05:34 GMT
All, thank you for your help, it works properly now.