Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

How object.HEIGHT scale is different from object.TOP?...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eugene - 11 May 2007 14:37 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.