Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2000
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Resizing Form (Access 97)

    I want to be able to dynamically resize a form's width before it opens, so I do me.width = <whatever> in the onOpen event.

    This resizes the size of the form (the gray backing part for example), but the window which represents the form is still the old size. How do I get the window to also resize? I tried turning autoresize on but this doesn't work. I also tried doing this in onLoad, but that didn't work either.

    Any ideas? I appreciate any and all help.

    Thank you,
    Chad

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Resizing Form (Access 97)

    I'm not clear on what you're doing. Using Me.Width only addresses the inside width of the form itself, it doesn't change the size of the window at ll.

    If you want to resize the window, use

    DoCmd.MoveSize , , dblWidth, dblHeight.

    Where dblWidth represents the new width in twips and dblHeight represents the new height in twips. Keep in mind, however, that you have to include the total height, which is the additive height of all sections of the form, including header and footer as well as detail, and you need to add a fudge factor for the difference between the inside and outside height and width of the form.

    There is code in the Access 97 Developer's Handbook to do this, so you can save yourself some work if you have a copy of that book.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Dec 2000
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Resizing Form (Access 97)

    Thank you. That worked perfectly.

    Chad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •