• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 572
  • Last Modified:

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

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 :))

1 Solution
Rey Obrero (Capricorn1)Commented:
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
bmtechAuthor Commented:
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now