peljo via AccessMonster.com said:
On opening the form, i want to give a command with Move To command to move
to
the right upper corner. Is there any such command ?
Paste this code into the declarations section of your form's module:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hWnd As Long, lpRect As Rect) As Long
Private Type Rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Then paste this in as your Form_Open event procedure:
Private Sub Form_Open(Cancel As Integer)
Dim r As Rect, w As Long
GetWindowRect GetDesktopWindow(), r
w = (r.Right - r.Left) * 15
DoCmd.MoveSize w - Me.WindowWidth, 0
End Sub
Now your form should open where you want it.