Results 1 to 10 of 10

Thread: Form Position

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Form Position

    There are properties for Width and height of a Form, which are
    Me.WindowWidth and WindowHeight

    Is there a property that gives the Top and the Left of the Form on Screen.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    There are properties for Width and height of a Form, which are
    Me.WindowWidth and WindowHeight

    Is there a property that gives the Top and the Left of the Form on Screen.
    I believe Grid X and Grid Y ... But don't quote me on that.
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    No Owen, they are used for objects to position them on the form..... Thanks

  4. #4
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Maybe you should use:

    me.Move(Left, Top, Width, Height)

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    No Owen, they are used for objects to position them on the form..... Thanks
    Ah yes ... Snap to grid ... I don't see any then. You'll have to use the Move method as noted previously ...
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Yes, I know that, but I want to open a form relative to the position of another opened form, therefore I am looking for a property that gives me the Left and top position of the already opend Form

  7. #7
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61

    Talking

    Well i geuss they forgot to put those properties in Access.

    But you can always try to move the form to the right position and turn auto center off:P

  8. #8
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Try DoCmd.MoveSize

  9. #9
    Join Date
    Dec 2001
    Posts
    79
    I think the GetWindowRect API will retrieve those values for you

    Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
    End Type

    Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long

    sub test_it()
    dim rctWindow as RECT
    GetWindowRect Forms!MyForm.hWnd, rctWindow

    msgbox rctWindow.left & " " & rctWindow.Top
    end sub

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  10. #10
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you pdebaets, that what I exactly wanted. Bummer that there is no such property for the form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •