Results 1 to 11 of 11
  1. #1
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239

    Resizing forms


    Hi,

    I have created different forms in resolution 1900x1200. If I open access DB from another computer with different resolution, all forms are scrambled - not displaying all form, just half of It.

    As I "Googled" this is quite an issue in Access and I'm wondering If there is any neat solution to overcome this problem. So far I have tried with glrScaleForm(), but can't make It work :

    this in new module :

    Code:
    Function glrScaleForm(frm As Form, intX As Integer, intY As Integer)
    
    
     frm.Name = "Form1"
     intX = 1900
     intY = 1200
         
    End Function
    ...And this in Open event of form:

    Code:
    Private Sub Form_Open(Cancel As Integer)
    Dim RetVal
             RetVal = glrScaleForm(Me, 1024, 768)
    End Sub
    Any other suggestions, or how can I get this working ?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You can resize the window a form is contained in but your controls are still going to be the same size. What is your objective?

  3. #3
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    I have 2 displays, one is 24inch and other 19inch, both sharing same desktop.

    I wish to fit my forms when minimizing them, or drag them into smaller screen - 19 inch. Something like HTML5 canvas to fit the screen, is that possible ?!?

  4. #4
    bigot is offline Advanced...ish
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    37
    Yes and No....

    No: There's no built in function to do this.
    Yes: You can do it, but it's gonna be pretty much manually done. The good news is you can sort of automate it...


    You can create a table for this. Each row would be for one control, providing its top/left/width/height properties (as a percentage of the form's size). When the form is resized, iterate the table and resize the elements.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Be aware that certain properties are not available during Run Time and can only be edited during Design Time. IIRC, in order to change the dimensions of a control you must open the form in DesgnMode before applying the changes. So something like ...
    Code:
    DoCmd.OpenForm "FormName", acDesign
    ...
    DoCmd.Save

  6. #6
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Oct 2013
    Posts
    239
    Can you post some short example to see how It can be done, and to compare It on my different displays ?

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You might look at FMSInc. They have a Form Resizer as part of "Total Access Components". But they are a little (very for me) pricy.
    https://www.fmsinc.com/microsoftacce...zer/index.html


    Then there is ShrinkerStretcher from Peter's Software ($39.99)
    http://www.peterssoftware.com/ss.htm

  8. #8
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    As I "Googled" this is quite an issue in Access
    it is an issue with any form from any system - but there are ways to control it, in a similar way to other form designs. It has always been a good principle of form design to design for the smallest resolution screen you would expect to use

    1. Upgrade to 2007 or later and you can anchor, stretch, etc as with other systems.
    2. or use the move command (or reference the controls top/left/width/height properties) to resize/reposition your controls in relation to the size of the form

    e.g. the following will always set the control to be a certain distance from the right hand side of the form - put it in your form resize event - then change the size of your window. Units are twips - there are 1440 twips to an inch (or 567 to a cm)

    mycontrol.left=insidewidth-mycontrol.width-60

    you will need to add some error handling to protect against the form being so narrow that it is less than the width of the control+60 or you widen the form so much it exceeds from limits (22 inches) which can occur if you stretch a form across a very large monitor or twin monitors)

    One I often use is to stretch a subform to the bottom of the form

    mysubformctrl.height=insideheight-mysumformctrl.top-60

    If you need to get into changing font sizes as well, that is a whole new ballgame but it's doable in code - or use one of the options suggested by sssnfu. Or google Stephen Lebans who has done a lot of work on forms/graphics manipulation

  9. #9
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239
    sassnfu & ajax, thanks for response.

    I don't want to use paid versions for that, I allready checked that before posting here. Do you have any small sample for what you are saying Ajax, I would like to see It ?

  10. #10
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    I've provided two examples, just understand the relationship between top and height, left and width

  11. #11
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239
    ok thanks, I tried, looks like the only option for me right now.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Resizing Forms
    By Lou_Reed in forum Access
    Replies: 12
    Last Post: 01-21-2016, 10:40 AM
  2. Resizing
    By AccessIgnorant in forum Forms
    Replies: 2
    Last Post: 12-13-2011, 10:59 AM
  3. Resizing a subform
    By tobydobo in forum Forms
    Replies: 3
    Last Post: 09-29-2011, 11:43 PM
  4. Resizing Forms (Properties affecting behavior)
    By ajetrumpet in forum Tutorials
    Replies: 0
    Last Post: 07-17-2011, 04:05 PM
  5. Resizing forms
    By wacky1 in forum Access
    Replies: 1
    Last Post: 01-22-2010, 09:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums