Access 2007 - Cannot Change Form Width and Height (1 Viewer)

cblaine99

Registered User.
Local time
Today, 08:09
Joined
Mar 10, 2016
Messages
29
Hello,

I am using Access 2007. I used VBA to print out all the properties for a form. I saw a number of formatting properties that were not listed on the Property Sheet, and I don't know how I could change them other than through VBA code.

Here are the form properties that are not shown on the Property Sheet (other than width): WindowWidth, WindowHeight, InsideWidth, InsideHeight, WindowTop, WindowLeft.

Does anyone know how these properties could be set (other than through VBA)?

Thank you.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 11:09
Joined
Apr 27, 2015
Messages
6,286
I have had similar problems with a split form. I ended up using DoCmd.MoveSize to fix the problem...but...that is with VBA so you may want to try something else.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:09
Joined
Feb 19, 2013
Messages
16,555
Does anyone know how these properties could be set (other than through VBA)?
they can only be set through VBA - e.g.

me.windowleft=200

or use move (but also in vba)

me.move 200,400,300, 200

typically these would be used in the form open event.

You might be able to set them using a macro, but I don't use those so cannot advise.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:09
Joined
Feb 28, 2001
Messages
27,003
In general, these properties cannot be set by anything OTHER than VBA if you want specific settings. However, I believe that you actually set (some of) these when you open the form in design mode and "grab the edge" of the form to change its size (where the cursor changes from the 4-way arrow to a 2-way resizing arrow) at the midpoints of the horizontal or vertical legs of the form's window or the corners of that window. If you resize the form manually in design mode and save it, those values get reset.

Otherwise, you would have to find the form's hwnd handle and use that to try to access the properties - but you would need some Windows API calls to be able to set those values, and there you are using VBA again.
 

Users who are viewing this thread

Top Bottom