We help IT Professionals succeed at work.

remember a forms location on the screen

davcos
davcos asked
on
Where can I change the setting so that a form will open in the same location it was when I closed it?  If I edit the form, move the location on the screen and save it, it will then always open in that location.  What I would prefer, is that it reopens in the spot where I last closed it.
Comment
Watch Question

Check below thread out, solution provided by Dirk Goldgar:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/4fb49579-25c8-47b6-a9a2-5f53b4429e33/

Hope this helps,
Daniel
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Easy. User the MoveSize Method:

The MoveSize method carries out the MoveSize action in Visual Basic.

expression.MoveSize(Right, Down, Width, Height)

Example .... and all values must be in Twips ... 1440 Twips/Inch

Private Sub Form_Load()
    DoCmd.MoveSize  1440*0.5, 1440*0.5, 1440*3, 1440*5
End Sub

mx

Author

Commented:
I guess I was thinking you could store the location "on close" and restore that location "on open".  Am I thinking about this incorrectly?
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Are you talking from an end user perspective or you as a developer when working on design ?

mx

Author

Commented:
As an end user.  We have several users of the database and they all use tables to do different tasks and would like the tables to come back where they were previously.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Tables?   Or Forms?

Author

Commented:
form
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
OK ...  

First ... be sure that Auto Center and Auto Resize are set to No.
Then ... before closing the Form - position it where desired, then File>>Save.  This will effectively 'save' the location of the form.  Next time when opened, it s/b in the same place.

mx

Author

Commented:
That's the problem, you would have to edit the form each time you wanted to save a new position.  We just want it to always open where we last closed it.

Thanks for all the response!
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
No no ... nothing to edit.
Basically .. it's File >>Save.

A one time setting ... be sure that Auto Center and Auto Resize are set to No.

mx

Author

Commented:
I have Auto Center and Auto Resize set to "No", but once I save the form, it always opens in the same position as I last saved it.  I'm trying to get the form to remember where it was the last time I closed it, and open in that location the next time.
Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
"it always opens in the same position as I last saved it."
Well, ok ... that's what I was saying.  But I see what you want is slightly different.  

Well ... I'll be.  Check this out.  Create a close button  like this:

Private Sub btnClose_Click()
 DoCmd.Close
End Sub

and put this in the Form Unload Event:

Private Sub Form_Unload(Cancel As Integer)
   DoCmd.RunCommand acCmdSave
End Sub

I moved the Form around, closed - opens in last position ... several times.

Be sure that Auto Center and Auto Resize are still set to No.

Author

Commented:
That will work!  Thank you!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.