• Placing forms at a specific screen location (A2K – SR1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Placing forms at a specific screen location (A2K – SR1)

    Author
    Topic
    #373958

    My question is more cosmetic in nature. How do we place our form to be opened at a specific screen each time? I find no mention of it in the help file.

    Viewing 0 reply threads
    Author
    Replies
    • #602984

      (1) If you set the AutoCenter property of a form to No, the form will be opened at the position it had when last saved. If you set it to Yes, the form will be centered (more or less) in the Access application window

      (2) You can use the MoveSize method of the DoCmd object to set the position of the active window explicitly. Example:

      DoCmd.OpenForm FormName:=”frmMyForm”
      DoCmd.MoveSize Right:=2880, Down:=1440

      For ordinary forms (Popup = No), the Right and Down values are measured from the top left corner of the client area of the Access window (immediately below the toolbars).
      For popup forms (Popup = Yes), the Right and Down values are measured form the top left corner of the screen.

      The arguments to MoveSize are in twips. There are 1440 twips in one inch, and 20 twips in one point. So in the example, the form will be positioned 2 inches to the right and 1 inch down from the top left corner.

      Notes:

      (a) This won’t work if you open the form with the WindowMode set to acDialog:

      DoCmd.OpenForm FormName:=”frmMyForm”, WindowMode:=acDialog

      In that case, the MoveSize instruction will only be executed *after* the form has been closed and applied to whatever window has the focus then.

      ( Take different screen resolutions into consideration. Developers often have larger resolution screens than end users. You don’t want to position a form entirely or partly offscreen.

    Viewing 0 reply threads
    Reply To: Placing forms at a specific screen location (A2K – SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: