ACC: MoveSize Action Does Not Position Form at Top of ScreenID: Q132010
|
Moderate: Requires basic macro, coding, and interoperability skills.
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.
The MoveSize action is triggered before the ShowToolbar action can fully hide the toolbar.
To work around this behavior, use one of the following methods:
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
Private Sub Form_Timer()
' In version 2.0, the DoCmd is written DoCmd <command>
DoCmd.MoveSize 0, 0
Me.TimerInterval=0
End Sub
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
This behavior is by design.
Private Sub Form_Activate()
' In version 2.0, the DoCmd is written DoCmd <command>
DoCmd.ShowToolbar "Form View", A_TOOLBAR_NO 'Hide Form view toolbar
DoCmd.MoveSize 0, 0 ' Position the form at the top of the screen.
End Sub
For more information about SetOption, search for "SetOption" using the Microsoft Access Help Index.
Keywords : FmsOthr
Version : 2.0 7.0 97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 28, 1999