Thursday, January 31, 2008

Scaling Access Forms

An open source VBA module for scaling Access forms for different display resolutions has been posted at SourceForge.

It is worth a look. I quickly tested the code in Access 2003, and for vanilla Access forms, it seems to work OK, subject to some tweaking(?):
  • Comment out the first line in the module
    Attribute VB_Name = "modScaleForm"
    as it does not compile and appears redundant

  • Change this line of code
    Dim fw As New clFormWindow
    to
    Dim fw As New Form
    as there is no such class module and using the Form object seems to work

  • Font-scaling needs attention
In Access 2007, you can use the new native Anchoring property for form controls to achieve scaling, but don't use these techniques on complex forms with subforms or tab controls, as the result is less than satisfactory...