Form Setup (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 06:29
Joined
Oct 30, 2008
Messages
1,257
I'm adding a Form to mdb Database in Access 2007
In properties I've turned off dividing lines, record selectors, min/max
and set default view to Single Form, with only Form View allowed.

Have also set popup and modal to Yes, and centered it.

Before I add controls to it, I'd like to set a Height and Width.
Seems there's only width available in Properties (or have I missed it?)
It's on 12.335cm which is it's width in design mode, but in run mode it's much bigger.

How can I lock in a Height value for the Form, plus have it use that width property setting ?

Thanks.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:29
Joined
Feb 19, 2013
Messages
16,609
width is the width of the form as specified in design. However it cannot be less that the right edge (left+width) of the rightmost control. Forms are displayed in windows and a window can be as wide or as narrow as you wish. Wider will just display the section background, narrower will hide the rightmost side of the form.

With regards height, a form has a number of sections - form and page headers and footers plus detail - each have their own height. And as with width it cannot be less than the bottom of the bottommost control (top+height) in the relevant section.

To fix the size of the window (which seems to be your problem), resize the window to what you want and then save the form.

You can also look at using the movesize command to position and size the window - see this link https://docs.microsoft.com/en-us/office/vba/api/access.docmd.movesize
 

June7

AWF VIP
Local time
Today, 10:29
Joined
Mar 9, 2014
Messages
5,466
Width is width of the design area.

Manually size the form frame (window) by grabbing and dragging corner anchor.

Height property is set with each section.

Do you have db set for Tabbed Documents or Overlapping Windows?
 
Last edited:

kirkm

Registered User.
Local time
Tomorrow, 06:29
Joined
Oct 30, 2008
Messages
1,257
Thanks for replys!
I recall MoveSize now you mention it, but I see no Move Size showing in the dropdown list, only Move and Moveable.
The Command would/should be Me.MoveSize in Form load event ?

Drag to size and save, doesn't seem to work here It is the wee save icon that Saves it ?

Can I ask something else please. Once an Option Group is setup, is it possible to return to the setup Wizard to make changes/additions ?

Thanks.
 

kirkm

Registered User.
Local time
Tomorrow, 06:29
Joined
Oct 30, 2008
Messages
1,257
> Do you have db set for Tabbed Documents or Overlapping Windows?
Sorry June, wouldn't know... just whatever the default might be?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:29
Joined
Feb 19, 2013
Messages
16,609
The Command would/should be Me.MoveSize in Form load event ?
depends on what the form is doing - but would suggest either there or the open event

Edit: and it is doCmd.MoveSize
 
Last edited:

kirkm

Registered User.
Local time
Tomorrow, 06:29
Joined
Oct 30, 2008
Messages
1,257
Thanks CJ, got it now... should have looked for the example the first time. Have it all now.. well, thus far awayway. I seldon use Access 2007 preferring 2003 as the new UI sends me batty...
But as regards height, even if split over the 3 components, can you not specify in code a total for all of them? I don't want/use a header or footer.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:29
Joined
Feb 19, 2013
Messages
16,609
if you are using 2003, then you have overlapping windows, tabbed documents came in in 2007.

can you not specify in code a total for all of them? I don't want/use a header or footer.
no - but if you hide the headers and footers (or set their heights to 0), that just leaves the detail section and you can specify the height there
 

kirkm

Registered User.
Local time
Tomorrow, 06:29
Joined
Oct 30, 2008
Messages
1,257
I'm using 2007.
I see Detail height in Properties, but like Form Width it doesn't work, except in Design view. How are these made to work at run time ?

I don't see any way to get at headers or footers,would they be 0 by default ? My Form seems be the Detail part only, which is just fine by me.
 

isladogs

MVP / VIP
Local time
Today, 19:29
Joined
Jan 14, 2017
Messages
18,209
Have a look at the example database I did the other day :
https://www.access-programmers.co.uk/forums/showpost.php?p=1601360&postcount=20
That includes code to check the dimensions and position of almost every part of a form
With luck, you'll find what you need

So in answer to your question, like almost everything else it needs to be done in code

If you aren't using form header/footer sections these won't exist so their height would effectively be zero - in reality probably null
So the detail height should equal the form inside height
 

Users who are viewing this thread

Top Bottom