Article ID: 148856
Article Last Modified on 1/19/2007
'====================================
' Global Declarations
'====================================
Option Compare Database
Option Explicit
'NOTE: The following declare statement is case sensitive.
Declare Sub SetWindowPos Lib "User32" (ByVal hWnd&, _
ByVal hWndInsertAfter&, _
ByVal X&, ByVal Y&, ByVal cx&, _
ByVal cy&, ByVal wFlags&)
Global Const HWND_TOP = 0 'Moves MS Access window to top
'of Z-order.
'Values for wFlags.
Global Const SWP_NOZORDER = &H4 'Ignores the hWndInsertAfter.
Function SizeAccess ()
Dim cX As Long, cY As Long, cHeight As Long
Dim cWidth As Long, h As Long
'Get handle to Microsoft Access.
h = Application.hWndAccessApp
cX = 0
cY = 0
cWidth = 640
cHeight = 480
'Position Microsoft Access.
SetWindowPos h, HWND_TOP, cX, cY, cWidth, cHeight, SWP_NOZORDER
End Function95934 ACC: How to Position Microsoft Access on the Screen
Additional query words: api resize size
Keywords: kbhowto kbprogramming KB148856