Capture the current position of a form after user moves it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working in Access 2003. I have a request from the users that they want to
be able to move forms in the application but have the application "remember"
the location and always reopen the form in that position for them. I've
thought of MoveSize referencing values saved in a table but how do I capture
the current position of the form when it is closed? It's probably something
simple that I'm overlooking...
 
Hi.
how do I capture
the current position of the form when it is closed?

Use the code from the Knowledge Base article on the following Web page:

http://support.microsoft.com/default.aspx?scid=143162
It's probably something
simple that I'm overlooking

No. It's definitely not simple. ;-)

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
'69 Camaro said:
Use the code from the Knowledge Base article on the following Web page:

http://support.microsoft.com/default.aspx?scid=143162


Gunny, am I missing something?

This seems to work in A2003

Private Sub Form_Close()
With CurrentDb.OpenRecordset("table1")
.Edit
!txtTop = Me.WindowTop
!txtLft = Me.WindowLeft
!txtHgt = Me.InsideHeight
!txtWdth = Me.InsideWidth
.Update
.Close
End With
End Sub

Private Sub Form_Open(Cancel As Integer)
With CurrentDb.OpenRecordset("table1")
Me.Move !txtLft, !txtTop
Me.InsideHeight = !txtHgt
Me.InsideWidth = !txtWdth
.Close
End With
End Sub
 
Thanks for pointing those out, Marsh! I've long forgotten about those
properties. (I was looking for Top and Left and didn't remember to look for
WindowTop and WindowLeft.) Doh! I found that KB article on a Google
search, but perhaps I should have searched a little further.

Gunny
 
Back
Top