Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Window - size to fit form (A97)

    I have a form with some command buttons that run queries and then open a report in preview mode. The form is about five inches by three inches, and it opens in a window sized to fit it. So far, so good.

    The reports open in a window that is too small to be useful - so the natural reaction is to maximize the window. However, when the user then closes the form view (typically after printing) the form loads again - but now it is in a maximized window, leaving the form in the upper left with an ocean of gray around it. The user MAY think to 'restore' the window (and then we are all happy) or he may try to close via the "X" close box (and then we are not happy). Either way, it looks very sloppy.

    I have looked for a command that would re-size the window back where it should be that I could attach to the 'gotfocus' event - it seems available for controls, but not for the window. Does anyone have any suggestions?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Window - size to fit form (A97)

    In the On Activate event of the form enter Docmd.Restore
    Francois

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Window - size to fit form (A97)

    BINGO!

    Thanks, Francois - works like a charm.

    It boggles my mind sometimes: - ask a question in Vancouver, Canada, go to lunch; and get an answer from Belgium!

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Window - size to fit form (A97)

    If you pay the trip, I bring you the aswer, but you'll have to wait ... say 24 h. Canada is one of the country's I want to visit someday. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Francois

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Window - size to fit form (A97)

    Hey Dean -- if you don't mind another answer from someone closer to home -- also in Vancouver.

    As standard operating practice, I put docmd.maximize in the Open event of all reports, and docmd.restore in the close event. That way you don't have to worry about which control was used to launch the report.
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

  6. #6
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Window - size to fit form (A97)

    Jack -

    I'll take help from wherever I can get it! Thanks, that was a good suggestion and I will keep it in mind.

Posting Permissions

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