Microsoft Knowledge Base Email Alertz

When you switch the focus away from a maximized form in a Microsoft Access database, the Resize event of the form that is losing focus fires unexpectedly.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 208358 - Last Review: June 24, 2004 - Revision: 2.0

ACC2000: Resize Event Fires Unexpectedly When Changing Form Focus

This article was previously published under Q208358
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

On This Page

SYMPTOMS

When you switch the focus away from a maximized form in a Microsoft Access database, the Resize event of the form that is losing focus fires unexpectedly.

CAUSE

When the form that is losing focus is in a maximized state and you are changing focus to another maximized object, the form's Resize event occurs. All multiple-document interface (MDI) objects that do not have focus are automatically restored to a windowed state behind the maximized MDI form that has focus. When the current form loses focus, Windows automatically restores it to a windowed state, causing the Resize event to occur.

MORE INFORMATION

The Resize event of a form fires whenever a change occurs that affects the size of a form:
  • When you first open a form.
  • When you resize a form using the keyboard or mouse.
  • When you maximize a form.
  • When you minimize a form.
  • When you switch focus away from a maximized form.
Switching focus away from a maximized form is an additional issue that you must consider when developing custom code that uses the Resize event of a form.

Steps to Reproduce Behavior

  1. Create a new database called Resize.mdb.
  2. Create the following form:
    Name: Test1
    Caption: TestForm
  3. Set the form's OnResize property to the following event procedure:
    Private Sub Form_Resize()
        MsgBox "The Resize Event Fired for " & Me.Name
    End Sub
    					
  4. Save the form as Test1, and then close it.
  5. Open the form in Form view; you receive the following message:
    The Resize Event Fired for Test1
    Click OK.
  6. Press F11 to bring the Database window into focus, and then maximize the Database window.
  7. On the Window menu, click 2 TestForm to bring the Test1 form into focus. You receive the following message:
    The Resize Event Fired for Test1
    Click OK.
  8. On the Window menu, click 1 Resize: Database to bring the main database window into focus. You receive the following message again:
    The Resize Event Fired for Test1
    This occurs because Access is restoring the form to a windowed state as it places it behind the main database window.

REFERENCES

For additional information about the behavior of maximized forms in Microsoft Access, click the article number below to view the article in the Microsoft Knowledge Base:
210123  (http://kbalertz.com/Feedback.aspx?kbNumber=210123/EN-US/ ) ACC2000: Maximizing One Form Maximizes All Forms
For additional information about using custom form properties to expose the Maximize and Minimize status of forms, click the article number below to view the article in the Microsoft Knowledge Base:
210190  (http://kbalertz.com/Feedback.aspx?kbNumber=210190/EN-US/ ) ACC2000: How to Determine If a Form Is Maximized or Minimized

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbprb KB208358
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate