Link to home
Start Free TrialLog in
Avatar of bejhan
bejhan

asked on

Changing and Retrieving Form Size

How can I retrieve the size of a form window that I have resized (via sizeable borders)? The reason I want to do this is because there is a whole bunch of hidden stuff on the right side of the form that only shows if a certain item is selected from a combo box. So I want to have the form start at the size that I have sized it to and change once that stuff becomes visible and change back if a different item is chosen from the combo box.

I was thinking of using DoCmd.MoveSize to resize the window, will this work?

Also is there a way to call autocenter from vba code?
ASKER CERTIFIED SOLUTION
Avatar of flavo
flavo
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Me.Move helps you move around the form, but it doesn't help you resize it. For that, you need to use the InsideWidth and InsideHeight properties:
http://msdn.microsoft.com/en-us/library/aa196143(office.11).aspx
You may have to use InsideWidth/Height in conjunction with what Dave mentioned, WindowHeight/Width, to achieve whatever exactly your desired effect is.
Avatar of bejhan
bejhan

ASKER

Actually in this case I was able to use Me.Move to resize and reposition.