Access 2007: Is there anyway to control Form positions by VBA?

Posted on 2009-04-29
Last Modified: 2013-11-28
Access 2007:
Is there anyway in which I can programatically control the position of a Form within Access? Currently the only method I can see is to drag the form in edit mode to your desired location and make sure you save it there. This has the obvious disadvantage that if you accidentally move a form whilst editing, but dont notice and then save it. You have to drag it back to correct your error.

What I would ideally like to do is specify a forms location either:
Degrees (0-360) and offset Realtive to the access screen centre... or
An Absolute screen location.

It strikes me as an obvious requirement. (ok maybe obvious only to me :))

Question by:bmtech
    LVL 119

    Accepted Solution

    you can position and change the size of the form with

    docmd.movesize right,down,width,height

    you can sue the command in the open or load event of the form

    the values are in twips   1 inch = 1440 twips
    LVL 2

    Author Closing Comment

    This seems to be an ability for absolute positioning width & height control. Great this starts me off in the right direct.

    Ok now all I need to do is work out a userfriendly method of creating an offset, shouldnt be too hard. All of my users use differing screen resolutions (very helpful). I already allow them to specify some default settings and store them in the registry using VBA,GETSETTING/SAVESETTING so I can just extend this idea and everyone gets a customised view. Hoorah!


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now