Form dimensions vs Inside dimensions

  • Thread starter Thread starter Frenchie
  • Start date Start date
F

Frenchie

Hello !

Upon opening a form, I get the following values :

frm.Width = 11355
frm.InsideWidth = 11640

How can a form width be smaller than its inside width ?

How can I correct this ?

Thanks
 
The Width property returns the width of the Form while the InsideWidth
property returns the width of the window that contains the form. There is no
fixed relationship between the two - the width of the window that contains
the form can be less than, equal to, or greater than the width of the form.

The help topic for the InsideWidth property explains this and includes some
sample code that illustrates the difference. (At least it does in Access
2003).
 
Thanks for your answer.

Is it possible that the form width doesn't take into account the space
required by the scrollbars and/or the record selector ?

I ask because I actually used the code sample provided in the help and
found that some of my forms had missing portions on their left.

There's why I examined the values and found those I reported in my
original post.

Since the code sample sets the window width equal to the form's width,
I was actually shrinking the window in a way the form did no longer fit
into it.

Hence my question.


Brendan Reynolds a pensé très fort :
 
The Width property remains the same regardless of whether scroll bars or
record selectors are visible or not ...

Private Sub Command18_Click()

Me.ScrollBars = 3 ' 3 = 'Both'
Me.RecordSelectors = True
Debug.Print "Width before: " & Me.Width
Me.ScrollBars = 0 ' 0 = 'None'
Me.RecordSelectors = False
Debug.Print "Width after: " & Me.Width

End Sub

Width before: 6349
Width after: 6349

This makes sense if you think about it, because the help file says that the
width of foms and reports is measured from the inside of their borders. The
record selector and scroll bar appear inside the form's borders, so the
distance between the insides of the borders does not change when these
elements are displayed or hidden.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top