How do you resize the Access Window When launching application

DCrake

Remembered
Local time
Today, 23:57
Joined
Jun 8, 2005
Messages
8,626
I have an Access App that has a mainform which is the start up form.

What I want to do is to first maximize the form.

DoCmd.Maximize

Then what I want to do then is to examine the Access Window Width and Height.

Me.WindowHeight
Me.WindowWidth

then state the following

Code:
If Me.WindowHeight > x then
   Me.WindowHeight = x
Endif

If Me.WindowWidth > y then
   Me.WindowWidth = y
Endif


Access states that this property cannot be set as it is read only.

This is to contend with wide screen monitors over a certain size. This is purely cosmetic but I like cosmetics.


Any help would be appreciated.


David
 
How about using:

Me.InsideHeight and Me.InsideWidth

I use those to set the form dimensions like:

Me.InsideHeight = 6700
Me.InsideWidth = 9000


Catalina
 
That's ok for the actual form but I want to resize the Access Window.
 
Yes, I didn't read the question right.
I need more coffee to wake up.

Catalina
 
I have actually got it to work, well 99.9% correct. The only thing that it does do that I don't want it to do is to hide my custom menu form the main form.

I use the following concept

Code:
Function MaximizeAccess() As Boolean


   MaximizeAccess = False
   Dim X As Long

   X = ShowWindow&(hWndAccessApp, 1)

   MaximizeAccess = True

End Function

My main form then has the following on the on load event

Code:
MaximizeAccess
Docmd.Maximize

It resizes the Access window to the outer dimensions of the main form but hides the custom menu.

David
 
Hey D

have you tried swapping them round? im sure you have

Code:
MaximizeAccess
Docmd.Maximize
Code:
Docmd.Maximize
MaximizeAccess

if you have no luck, i can send over a module i use to completely minimize the window on startup. it also has an option to completely maximize


Nidge
 
Nidge,

Do you know I thought about that last night, and I am going to try it later. What I am also goiing to do is to put the MaximizeAccess function on a timer to allow the main form to open and size itself first.

Will let you know how I get on.

David
 
I had similar problems with my applications. My database consist of a lot of sub and even to a thrd level of sub forms. The screen resizers did not really help me. The other problem is that it really stuff the icons on your buttons.

I have done what you have done, I gave all the forms a fixed size to fit a small screen and centre it. No matter what size screen you use it will be centred and looks neat.

Best of luck!
 
Problem I have today is that the laptop I am working on is the correct screen res (1024x768). It's the larger ones I need to trap.

David
 
Try this, I use one. I make it to fit max on a small screen, and will then be the same size on a larger one. Put it on all your forms and they will overlay oneanother. Not the perfect solution but works for me. I really battled with screen sizes.
 

Attachments

I have actually got it to work, well 99.9% correct. The only thing that it does do that I don't want it to do is to hide my custom menu form the main form.

I use the following concept

Code:
Function MaximizeAccess() As Boolean
 
 
   MaximizeAccess = False
   Dim X As Long
 
   X = ShowWindow&(hWndAccessApp, 1)
 
   MaximizeAccess = True
 
End Function

My main form then has the following on the on load event

Code:
MaximizeAccess
Docmd.Maximize

It resizes the Access window to the outer dimensions of the main form but hides the custom menu.

David


Where do you put the Function MaximizeAccess code?

Thanks

Linda
 

Users who are viewing this thread

Back
Top Bottom