ACC: MoveSize Action Does Not Position Form at Top of Screen (132010)
The information in this article applies to:
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q132010
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the MoveSize action to position a form at the top of the
screen after hiding the form's toolbar with the ShowToolbar action,
there is a gap between the menu bar and the top of the form equal in
size to the hidden toolbar.
CAUSE
The MoveSize action is triggered before the ShowToolbar action can fully
hide the toolbar.
RESOLUTION
To work around this behavior, use one of the following methods:
Method 1 (All versions)
Set the form's OnActivate property to the following event procedure:
Private Sub Form_Activate()
' In version 2.0, the DoCmd is written DoCmd <command>
Me.TimerInterval=500
DoCmd.ShowToolbar "Form View", A_TOOLBAR_NO
End Sub
Set the form's OnTimer property to the following event procedure:
Private Sub Form_Timer()
' In version 2.0, the DoCmd is written DoCmd <command>
DoCmd.MoveSize 0, 0
Me.TimerInterval=0
End Sub
Method 2 (Versions 2.0 and 7.0 only)
Set the form's OnActivate property to the following event procedure:
Private Sub Form_Activate()
' In version 2.0, the DoCmd is written DoCmd <command>
Application.SetOption "Built-In Toolbars Available", False
DoEvents
Application.SetOption "Built-In Toolbars Available", True
DoCmd.ShowToolbar "Form View", A_TOOLBAR_NO
DoCmd.MoveSize 0, 0
End Sub
STATUS
This behavior is by design.
REFERENCES
For more information about SetOption, search for "SetOption" using the
Microsoft Access Help Index.
Modification Type: | Major | Last Reviewed: | 5/7/2003 |
---|
Keywords: | kbprb KB132010 |
---|
|