none
Can I open a non-dialog form to a fixed size? RRS feed

  • Question

  • I'm trying to make a non-dialog form open to a fixed size with thin borders. The only way I can find to open the form to a specific size is to set border style to Dialog, but that causes the form to have wide borders and large title bar at top--which I don't want. Any other combination of settings I try causes the form to open to maximum size.

    Any suggestions are appreciated.
    Mike

    Friday, March 3, 2017 12:41 AM

All replies

  • Hi Mike,

    You could use DoCmd.MoveSize Method (Access) in form_load event to change the form size.

    E.g.

    Private Sub Form_Load()
    DoCmd.MoveSize 1440, 2880, 2000, 2000
    End Sub
    

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 6, 2017 9:17 AM
    Moderator
  • Do you have the option set in this database to open document windows as "Tabbed Documents", rather than "Overlapping Windows"?  If you have it set to "Overlapping Windows", then forms will open to their designed size if the form's Auto Resize property is set to Yes.

    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Monday, March 6, 2017 6:49 PM
  • Actually, you can size a dialog form or a popup form to how you want.

    The “trick” however centers on if you using tabbed forms (all forms maxed except for popup and dialog forms). In this case, you “change” Access to use overlapping windows.

    Now, simply launch the form in question (design mode). Set auto center/Auto Resize/Fit to screen ALL to “no”.

    Now change the border to sizable. Set now flip the form into form view. Re-size the form exactly how you want. Hit control-s to save this. Now flip the form into design mode, and change the border to “thin”. Now close the form (yes to save changes).

    At this point you can re-launch the form to ensure it exactly how you sized it. I done above for years – even before Access had “tabbed” forms as opposed to overlapping windows.

    If the rest of your application runs as tabbed windows, then change that setting back. Just keep in mind that if you need to modify or change that form – you want to flip back into overlapping windows mode.

    So you can rather well size forms, and SET their size and it will stick quite nice to how you sized that form.

    Key detail you left out is Dirk asking in this thread are you running your application as overlapping windows, or tabbed. So how to fix the form will change depending on your application wide setting of how forms are to display (tabbed or overlapping).

    Regards,
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada

    Tuesday, March 7, 2017 9:20 PM