schmir1
asked on
How to get the DB window to come up maximized.
Most times when I start my Access2000 front-end, it comes up as non-maximized size (normal). When I use my shortcut, I would like it to come up maximized. I've set the property of the shortcut to maximized and no help. When the front-end comes up, I do a save on the switchboard and then it stays maximized for that day but it is back to normal the next day. I believe that my maintenance routines that run every night runs normal mode (which I don't want to change). I just want it to come up maximized when I start it from my shortcut.
Any Ideas?
Any Ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or call it through your autoexec macro, if you use one.
i've been looking through my database that holds misc VBA code but i couldn't find my module that i paste all of my API calls into.
andrew
i've been looking through my database that holds misc VBA code but i couldn't find my module that i paste all of my API calls into.
andrew
- In "On Active" event of your Switchboard from add mcrMax.
Where mcrMax is a macro you need to create with one line of Action called 'maximize'.
Regards,
Mike
Where mcrMax is a macro you need to create with one line of Action called 'maximize'.
Regards,
Mike
Private Sub Form_Load()
'minimize database window and load the form
On Error GoTo Form_Open_Err
'minimize backend, maximize front end
DoCmd.SelectObject acForm, "Start Form", False
DoCmd.Maximize
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.description
Resume Form_Open_Exit
End Sub
'minimize database window and load the form
On Error GoTo Form_Open_Err
'minimize backend, maximize front end
DoCmd.SelectObject acForm, "Start Form", False
DoCmd.Maximize
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.description
Resume Form_Open_Exit
End Sub
Revision:
- In "On Active" event of your Switchboard from add DoCmd.Maximize
- In "On Active" event of your Switchboard from add DoCmd.Maximize
You can maximise the parent window (rather than the child windows) by adding the following code to your application:
DoCmd.RunCommand acCmdAppMaximise
DoCmd.RunCommand acCmdAppMaximise
Sorry, that should have been:
DoCmd.RunCommand acCmdAppMaximize
DoCmd.RunCommand acCmdAppMaximize
Key point here is the location of DoCmd.Maximize.
It should be in "On Active" event. The reason for this choice is:
We may call a dialogue form to interact with application affter Switchboard is loaded. This dialogue form will most likely will reset Maximize setting. Therefore, after closing of the dialogue form, "On Active" of Switchboard will kick in an Maximize it again.
Thx,
Mike
It should be in "On Active" event. The reason for this choice is:
We may call a dialogue form to interact with application affter Switchboard is loaded. This dialogue form will most likely will reset Maximize setting. Therefore, after closing of the dialogue form, "On Active" of Switchboard will kick in an Maximize it again.
Thx,
Mike
The DoCmd.Maximize function, as far as I know, only works for the active form, not the actual application window. To maximize the application window, you will probably need to use the API function I mentioned earlier.
Private Sub Form_Load()
'minimize database window and load the form
On Error GoTo Form_Open_Err
'minimize backend, maximize front end
DoCmd.SelectObject acForm, "Start Form", False
DoCmd.Maximize
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.description
Resume Form_Open_Exit
End Sub
'minimize database window and load the form
On Error GoTo Form_Open_Err
'minimize backend, maximize front end
DoCmd.SelectObject acForm, "Start Form", False
DoCmd.Maximize
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.description
Resume Form_Open_Exit
End Sub
Sorry disregard the comment above this one :)
Hi mgrattan,
Your answer to <to get the DB window to come up maximized> is more appropriate.
I have 2nd guesed schmir1 question as <to get the form in DB window to come up maximized>.
That is for schmir1 to say if my take whether my take was correct or not (in spite of the question statement).
Take Care,
Mike
Your answer to <to get the DB window to come up maximized> is more appropriate.
I have 2nd guesed schmir1 question as <to get the form in DB window to come up maximized>.
That is for schmir1 to say if my take whether my take was correct or not (in spite of the question statement).
Take Care,
Mike
ASKER
Sorry about the confusion. I was interested in a solution that made the Access Window (not the form) maximized and mgrattan's does the job.
Thanks
Thanks
Glad to help!
Out of interest, what was wrong with:
DoCmd.RunCommand acCmdAppMaximise
If this works I'd say it's simpler to use VB code, rather than calling run-time library functions.
DoCmd.RunCommand acCmdAppMaximise
If this works I'd say it's simpler to use VB code, rather than calling run-time library functions.
ASKER
Sorry JezWalters. I took too brief a look at your solution. I saw the DoCmd.RunCommand and I thought it was a form maximizer. I wish there was some way to give you credit. It does look like a very simple solution.
Reminds me to look more closely in the future.
>>> Bob <<<
Reminds me to look more closely in the future.
>>> Bob <<<
On the bright side, you can still use my solution and nexusnation, mgrattan, eghtebas & lucas911 should know about it now too!
there isn't a way to detect how your database opened. however, you could maximize the window depending on my time of day.
what do you mean by "normal" here?
" I believe that my maintenance routines that run every night runs normal mode (which I don't want to change). "
andrew