Database screen does not open centered in screen

WinDancer

Registered User.
Local time
Today, 03:36
Joined
Oct 29, 2004
Messages
290
Sometimes it opens way to the top, others times way to one side or the other, sometimes on the bottom. Tjhis is so bad that sometimes the screen is mostly off the viewing screen.....
This occurs even when it is the only screen open.
Any ideas?
TIA,
Dave
 
Dave,

One easy is to use the form's OnOpen event and:

DoCmd.MoveSize

You'll have to tailor the arguments for the desired size/position.

Wayne
 
Are you talking about the Database window rather than a form?
 
Here is what I use. Albeit right or wrong, it works for me.

Using a Master Module, in your global declarations put...

Code:
'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.

Creat a Sub in the module...
Code:
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

and in the Form_Open sub of the main DB form...
Code:
    Call SizeAccess(a, b, c, d)
    '     a=across b=down  c=Height d=Width

Hope this helps.

Brett
 
I am talking about the main Access database window when the system starts- Access starts with that screen centered under normal conditions. Other forms I can adjust easily...
 
Does it do the same thing when you open the db while holding down a <SHIFT> key? What version of Access are we talking about here?
 
Of course it isn't doing it today... Access 2003...
I will check the shift key next time it happens and post back
 
Now I am not sure if the opening dbase window is not centering when I have just that open or not.
I know when I am working between forms that OFTEN when I open another form it opens so that it is off kilter with the main dbase screen and I have to move both forms to get them centered and eliminate the scroll bars.
I usually select NO to the autocenter property so I can locate the screen where I want it so that when a user is in the application they can see two screens and read them both.
I have no choice about SPs- my employer makes that decision and they don't do anything they can avoid with our old buddy Bill :) We are just getting set for the upgrade to Office 2007- without Vista.
Thanks for the input :)
 
As mentioned by others, the MoveSize command allows you to put your form wherever you want.
 
WinDancer,

The code I previously posted will put your main form in the RIGHT place with an EXACT form size EVERY time.
 

Users who are viewing this thread

Back
Top Bottom