Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Form sizes

144 views
Skip to first unread message

Phil

unread,
Dec 22, 2015, 12:43:48 PM12/22/15
to
Can anyone explain

I have anbound form with no form header or footer, only the detail

There is the following code

Option Compare Database
Option Explicit

Private Sub Form_Open(Cancel As Integer)

Debug.Print "Detail Height: " & Me.Section(acDetail).Height _
& & " Inside Height: " & Me.InsideHeight & " Window Height: " &
Me.WindowHeight _ & " Window Width: " & Me.WindowWidth _
& " Width: " & Me.Width & " Inside Width: " & Me.InsideWidth

End Sub

If I set the Border style to "None" I get
Detail Height: 3288 Inside Height: 3270 Window Height: 3555 Window Width:
7530 Width: 6994 Inside Width: 7530

If I set the Border style to "Sizable" without changing anything else, I get
Detail Height: 3288 Inside Height: 7440 Window Height: 8370 Window Width:
9330 Width: 6994 Inside Width: 9030

So what are inside heights that can be either bigger or smaller than the
detail height? Why is the inside width greater than the form width?

Am I correct in assuming all measurements are in Twips?

It would appear that the Navigation Button is 285 high (3555-3270) and that
visually looks about right and the vertical borderS (top + bottom is 645 high
(8370-7440-285)

Is there a guide to what the various sizes mean?
Where do scrollbars, navigation buttons, Scrollbars control boxes etc. fit
into the measurement system?

TIA

Phil

Ulrich Möller

unread,
Dec 22, 2015, 1:34:10 PM12/22/15
to
Hi Phil,

all measurements in twips:
- WindowWidth/-Height is the outer window dimension
- InsideWidth/-Height is the inner window dimension
- Width and Height reference the formular width and height.

If the formular is greater than the window inside dimension you will see
scrollbars (if enabled).

' formular dimension:
formularheight = me.section(0).height + me.section(1).height +
me.section(2).height
formularwidth = me.width

' window dimension:
windowheight = me.insideheight
windowwidth = me.insidewidth

' resize the window dimension so that the formular will fit inside the
window
if windowwidth <> formularwidth then me.insidewidth = formularwidth
if windowheight <> formularheight then me.insideheight = formularheight

Ulrich




Phil

unread,
Dec 23, 2015, 4:47:12 AM12/23/15
to
Thanks Ulrich, as ever I appreciate your feedback.

I am still confused.

Your explanation seems to imply that
Window Width >= InsideWidth >= Width which is what the examples above
demonstrate.

Then you go on to say that if Width > InsideWidth you will see the scrollbars

Am I correct in assuming this should say
InsideWidth > Width you will see the scrollbars

Thanks

Phil

Ulrich Möller

unread,
Dec 23, 2015, 7:09:25 AM12/23/15
to
Am 23.12.2015 um 10:46 schrieb Phil:
Hi Phil.

no, your assumption is no correct.

The width and height dimension are normally determined at design time by
the form's size needed to display your controls.
The inside dimension reflects the inner size of the viewable region of
the window and it can be, that your designed form size is greater than
the current inner window size. In this case you will see the scrollbars
and me.width/-height is greater than insidewidth/-height.

Keep in mind, that there also exists some autosize features that will
influence the sizing of your form, at least the accesss option for
overlapped forms and the layout feature in newer access versions.

Ulrich

Phil

unread,
Dec 23, 2015, 3:37:12 PM12/23/15
to

> no, your assumption is no correct.
>
> The width and height dimension are normally determined at design time by
> the form's size needed to display your controls.
> The inside dimension reflects the inner size of the viewable region of
> the window and it can be, that your designed form size is greater than
> the current inner window size. In this case you will see the scrollbars
> and me.width/-height is greater than insidewidth/-height.
>
> Keep in mind, that there also exists some autosize features that will
> influence the sizing of your form, at least the accesss option for
> overlapped forms and the layout feature in newer access versions.
>
> Ulrich
>
>
Thanks again.

What I am trying to do - its a bit complicated
I have 3 continuous forms that I need to display on different sized screens.
These are Transactions, Expected Debits and Expected Credits
Basically there is a large form in the left taking up pretty well all the
height and 3/4 of the screen On the right are 2 identical forms, one below
the other, but with different RecordSources, so their lengths vary depending
on the number of records.

I use ShrinkerStretcher from Peters software to size the forms to fit the
Access window size. This works well. Using the Transaction form width, I can
position the Expected Debits form to the right of the Transaction form at the
top of the screen, and the Expected Credits immediately below that.

I then need to adjust the height of the form so that, if there is enough
room, the vertical scrollbars vanish, and that is where the problem comes.

On the Expected Debits form,
FrmHeight = (Me.FormHeader.Height + Me.FormFooter.Height + Me.Detail.Height *
(RecCount + 1)) + 975 DoCmd.SelectObject acForm, Me.Name
DoCmd.MoveSize TransFormWidth, 0, SpaceForDDForm - 150, FrmHeight
Again this works though not 100% depending on the Access area. The 975 is
kludge

On the Expected Credits form,
FrmHeight = (Me.FormHeader.Height + Me.FormFooter.Height + Me.Detail.Height *
(RecCount + 1)) + 1110 DoCmd.SelectObject acForm, Me.Name
DoCmd.MoveSize TransFormWidth, 0, SpaceForDDForm - 150, FrmHeight
Again this works though not 100% depending on the Access area. The 1110 is
kludge

Why 975 works for one and I have to use 1110 for the other is beyond me.
In addition, even though the forms are not updateable, I seem to have to
leave enough space between the last record and the footer to stop the
scrollbars showing, hence the RecCount + 1

Any further thoughts please?

Phil

Ulrich Möller

unread,
Dec 23, 2015, 5:34:59 PM12/23/15
to
Hi Phil,

i don't know ShrinkerStretcher, but have a short look at for some hints:

http://www.utteraccess.com/wiki/index.php/Dynamically_Resize_Continuous_Dialog_Form_To_Match_Number_Of_Records

I personal prefer to control the form's dimension over the inside
properties. I would calculate the needed height according to the detail
section height and the number of displayed records. With this value i
resize the form using insideheight and after that i do the repositioning
of the window itself. For this reposition i use the windowheight and
windowwidth properties or some api calls so i have eliminated any
problems with borders and other decorations.

Ulrich


Phil

unread,
Dec 24, 2015, 9:08:12 AM12/24/15
to

>>
> Hi Phil,
>
> i don't know ShrinkerStretcher, but have a short look at for some hints:
>
> http://www.utteraccess.com/wiki/index.php/Dynamically_Resize_
Continuous_Dialog_Form_To_Match_Number_Of_Records
>
> I personal prefer to control the form's dimension over the inside
> properties. I would calculate the needed height according to the detail
> section height and the number of displayed records. With this value i
> resize the form using insideheight and after that i do the repositioning
> of the window itself. For this reposition i use the windowheight and
> windowwidth properties or some api calls so i have eliminated any
> problems with borders and other decorations.
>
> Ulrich
>
>

Thanks, the combination of your advice on window sizes and the link to hiding
the scrollbars all works a treat

Have a good Xmas

Phil

0 new messages