none
MS Access form sizing

    Question

  • We are using Access 2002. I want to set the form size so that it is optimal for a screen resolution of 1024 x 768. Most of our users are using 19" (4x3) flat panels. (Some have wide screens but these are still in the minority.) 1024 x 768 is the least common denominator especially if they are using Citrix to access the application. I know how to use the movesize command but how do I optimize the view since the movesize command is expecting inches or centimeters? Ideally, I'd like to get the screen resolution and set the height to 768 or the screen height minus 30 pixels and the width to 1024 or screen width minus 30 pixels. This was fairly simple in VB.
    Thursday, August 26, 2010 8:08 PM

Answers

  • Rod, this is not simple in Access. There was some code to do this (in Chapter 8 of Ken Getz et al, Microsoft Access xx Developers Handbook), but it's fraught with snags to overcome. IMHO, it's best to design your forms for the minimum resolution (1024x768), and just accept how it looks on higher resolution screens.
     
    Among the issues to solve are controls that contain other controls, e.g. tab control, option group, subform. You have to size the outer control first (if increasing in size), or the inner controls first (if decreasing in size.) When moving, the outer control has to be large enough to contain the inner ones while moving.
     
    You may also want to consider the other possibilities that could occur, e.g. how your forms will look on a monitor that's rotated to portrait (yes: I do have one of those), whether users who bought large monitors really want your app running full screen, and whether some users might prefer to have multiple MDI windows open rather than one form filling the entire O_MAIN Access workspace.

    --
    Allen Browne - Microsoft MVP.  Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.
    We are using Access 2002. I want to set the form size so that it is optimal for a screen resolution of 1024 x 768. Most of our users are using 19" (4x3) flat panels. (Some have wide screens but these are still in the minority.) 1024 x 768 is the least common denominator especially if they are using Citrix to access the application. I know how to use the movesize command but how do I optimize the view since the movesize command is expecting inches or centimeters? Ideally, I'd like to get the screen resolution and set the height to 768 or the screen height minus 30 pixels and the width to 1024 or screen width minus 30 pixels. This was fairly simple in VB.

    Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to forum, rather than allenbrowne at mvps dot org.
    Friday, August 27, 2010 12:46 AM

All replies

  • Rod, this is not simple in Access. There was some code to do this (in Chapter 8 of Ken Getz et al, Microsoft Access xx Developers Handbook), but it's fraught with snags to overcome. IMHO, it's best to design your forms for the minimum resolution (1024x768), and just accept how it looks on higher resolution screens.
     
    Among the issues to solve are controls that contain other controls, e.g. tab control, option group, subform. You have to size the outer control first (if increasing in size), or the inner controls first (if decreasing in size.) When moving, the outer control has to be large enough to contain the inner ones while moving.
     
    You may also want to consider the other possibilities that could occur, e.g. how your forms will look on a monitor that's rotated to portrait (yes: I do have one of those), whether users who bought large monitors really want your app running full screen, and whether some users might prefer to have multiple MDI windows open rather than one form filling the entire O_MAIN Access workspace.

    --
    Allen Browne - Microsoft MVP.  Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.
    We are using Access 2002. I want to set the form size so that it is optimal for a screen resolution of 1024 x 768. Most of our users are using 19" (4x3) flat panels. (Some have wide screens but these are still in the minority.) 1024 x 768 is the least common denominator especially if they are using Citrix to access the application. I know how to use the movesize command but how do I optimize the view since the movesize command is expecting inches or centimeters? Ideally, I'd like to get the screen resolution and set the height to 768 or the screen height minus 30 pixels and the width to 1024 or screen width minus 30 pixels. This was fairly simple in VB.

    Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to forum, rather than allenbrowne at mvps dot org.
    Friday, August 27, 2010 12:46 AM
  • For getting Screen resolution in pixels you can use API.

    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    
    Public Function GetScrResX As Long
      GetScrResX = GetSystemMetrics(0)
    End Function
    
    Public Function GetScrResY As Long
      GetScrResY = GetSystemMetrics(1)
    End Function
    

    So, you can use GetScrResX to get a width in px and GetScrResY to get a heigth in px.


    Andrey V Artemyev | Saint-Petersburg, Russia
    Friday, August 27, 2010 7:06 AM