+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Contributor
    Join Date
    09-23-2007
    Posts
    109

    Maximise a Userform in Window

    Hi
    Every time I Open my userform in access (by clicking on the forms shorcut) the window opens and the userform appears in a no quiet maximised state. I have to click on the maximise symbol on the top right corner to make it fit the window.

    Is there any setting or property which will automatically maximise the form to the size of the window. I can use a macro which works fine though there must be a standard way of doing this.

    Thanks
    Danny2000
    Last edited by danny2000; 04-21-2009 at 05:52 AM.

  2. #2
    Forum Administrator
    Join Date
    03-18-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Maximise a Userform in Window

    I just created a UserForm for a test. I put the width and height dimensions in the initialize event like this:

    Code:
    Private Sub UserForm_Initialize()
    With UserForm1
    .Width = 640
    .Height = 480
    End With
    End Sub
    Then in the VBA module I use:
    Code:
    Sub UFtst()
    UserForm1.Show(Modal)
    MsgBox "Check Size"
    Unload UserForm1
    End Sub
    It brings the form up in the larger dimension, which indicates that you can set it to fit your full screen size.
    ExlGuru

  3. #3
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,798

    Re: Maximise a Userform in Window

    Hi danny2000,

    Insert this code in your form's code window:

    Code:
     
    Private Sub Form_Open(Cancel As Integer)
         DoCmd.Maximize
    End Sub
    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Contributor
    Join Date
    09-23-2007
    Posts
    109

    Talking Re: Maximise a Userform in Window

    Fantastic. Thanks very much.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0