Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 - Maximizing the access application window on startup.

Status
Not open for further replies.

JimmyL

Programmer
Dec 19, 2001
19
GB
Is it possible to add some VB code into my database to automatically maximize the Access application window when I start the database up?

As the default form is designed to be smaller than screen size, I don't want that maximized, only the entire Access application window.

Can anyone help?

Cheers, JimmyL
 
Sub WinSize(strSize As String)
Select Case strSize
Case "Max"
DoCmd.RunCommand acCmdAppMaximize
Case "Min"
DoCmd.RunCommand acCmdAppMinimize
Case "Rest"
DoCmd.RunCommand acCmdAppRestore
Case Else
MsgBox strSize & " is not a valid argument"
End Select
End Sub

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thanks Robert,

Worked first time!

Cheers, JimmyL
 
Where do i need to locate this sub in order for it to work?
Thanks!

 
Put it in the on open event of the form called at start up. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
This is the Event Procedure I have listed under my On Open Section of my Main Menu form. Can you tell me what's wrong with it! Thanks for your help!


Private Sub Form_Open(strSize As String)
Select Case strSize
Case "Max"
DoCmd.RunCommand acCmdAppMaximize
Case "Min"
DoCmd.RunCommand acCmdAppMinimize
Case "Rest"
DoCmd.RunCommand acCmdAppRestore
Case Else
MsgBox strSize & " is not a valid argument"
End Select
End Sub
 
Nope. Can’t do it like this.

Take the function I gave and put it in a global module.
Now. In the on open event of your form (and remember the only argument for an open event is Boolean).

From somewhere in that event, jus insert

Winsize(“MAX”)

That’s all you have to do.


Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thank you for your help but what exactly is the global module? Do I have to create it or when I created my database did it default somewhere? How do I access it to add this sub? What is Boolean?
Sorry, I'm just new to this! Thank you for your help!

ree~
 
I figured it out.
I just added DoCmd.Maximize into the On Open Event Procedure

Thank You though
:)

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top