patternMinor
VBA Maximize Access Application Main Window
Viewed 0 times
mainapplicationmaximizevbawindowaccess
Problem
I need my access application window to open up in full screen. I have tried using:
and
Neither is working for me? I put the VBA code in the
I think i need to set focus to the actual Access Application (main window) first and then run the
I noticed that if I click the command button with
Anyone had any luck with this before?
Update:
Not sure why but the only way i can get the
to work, is by first calling the
and then calling the
DoCmd.RunCommand acCmdAppMaximizeand
DoCmd.Maximize (which I think only maximizes a Form).Neither is working for me? I put the VBA code in the
OnLoad event and I also tried putting it in the Click Event of a command button.I think i need to set focus to the actual Access Application (main window) first and then run the
DoCmd.RunCommand acCmdAppMaximize command but am not sure how to achieve this. I noticed that if I click the command button with
DoCmd.RunCommand acCmdAppMaximize nothing happens but If first I move the window around (by dragging it's title bar) and then I click the button it will actually Maximize the Window.Anyone had any luck with this before?
Update:
Not sure why but the only way i can get the
DoCmd.RunCommand acCmdAppMaximizeto work, is by first calling the
DoCmd.RunCommand acCmdAppMinimize (minimize window first)and then calling the
DoCmd.RunCommand acCmdAppMaximize (and then maximize)Solution
I've spend a while battling with this problem too, reading various blogs and posts. I've found a very simple way to achieve the desired outcome in VBA using just one line of code. In the VBA editor, place this code AFTER your On Load code:
[Your On Load code]
KeyCode = 16
This code achieves the equivalent of pressing F11, ie maximising the view of the currently open window.
[Your On Load code]
KeyCode = 16
This code achieves the equivalent of pressing F11, ie maximising the view of the currently open window.
Context
StackExchange Database Administrators Q#57653, answer score: 3
Revisions (0)
No revisions yet.