Resizing Forms for Different Resolutions

Tuesday, June 11, 2002 23:46:39
home

There is a link here at the Dev Ashish website which is where I derived much of my information.

Situation: you have developed your Access database using a 1024x768 screen resolution. But your users are using a 800x600 resolution setting on their PCs. As a result, your forms are not fitting on one screen and there are loads of very annoying "scroll bars" everywhere. Unlike other Office applications, there is no "zoom" control to make this an easy thing to deal with. Is there a way to automatically resize the forms depending on users' display properties?

There is code contained in a very highly recommended book, the Access 97 Developer's Handbook, which describes how to do this. I have very recently discovered, the code can be downloaded from the Developer's Handbook website free of charge. (The catch is that you don't get to see the actual code, whereas if you buy the book you can.) Included is a PDF file describing exactly how to do make it work.

Also, you can purchase a utility developed by Peter Dabeats which also handles it; it can be downloaded from here.

Brief Instructions: How to Use the Database Developer's Code

I highly recommend the previous links for better information. However, as a quick reference tool in case you already have used the Database Developer's Handbook method before and just need a quick "how-to" for the sake of being reminded, here goes.

  • Download the MDE file (97 2000)
  • Reference the MDE file in your database
  • Add the following code to the form's "declaration" section

    Private frmResize As ADHResize97.FormResize
    (this code assumes you're using the 97 version)
  • Add the following code to the form's "on open" event procedure:
        Set frmResize = ADHResize97.CreateFormResize
        Set frmResize.Form = Me
        Call frmResize.SetDesignCoords(1024, 738, 96, 96)

    (The 1st line would be modified if you were using the 2000 version, and the 3rd line assumes the form was originally designed in 1024x768; if not, that line would also be edited.