The following code by Ghudson resizes the form. Add the code to your form and then view your form and position it to where you want on the screen and save. The DoCmd.Restore then remembers the last position.
=======================================================
© Ghudson
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
'Added by Allan L Taylor
DoCmd.Restore
'just for testing
'MsgBox "InsideHeight = " & InsideHeight & vbCrLf & vbLf & "InsideWidth = " & InsideWidth
InsideHeight = 5450 'twips is the unit of measurement
InsideWidth = 7870
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Form_Open
End Sub
========================================================
The following code resizes and moves the whole access window, design your forms to fill the area you selected.
Usage: add to form on load event add:- SizeAccess 130, 40, 600, 800
'note first two parameters are screen position, last two are size
Create a module and add the following.
'====================================
' 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&)
'Moves MS Access window to top of Z-order.
Global Const HWND_TOP = 0
'Values for wFlags.
Global Const SWP_NOZORDER = &H4 'Ignores the hWndInsertAfter.
Function SizeAccess(cX As Long, cY As Long, _
cHeight As Long, cWidth As Long)
Dim h As Long
'Get handle to Microsoft Access.
h = Application.hWndAccessApp
'Position Microsoft Access.
SetWindowPos h, HWND_TOP, cX, cY, cWidth, _
cHeight, SWP_NOZORDER
End Function