X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Positioning The Access Window On Startup, Access 2010    
post Apr 29 2015, 10:14 PM

Posts: 509
Joined: 23-November 11
From: Tampa, Florida, USA - UTC -5:00

This is a demo project that has very simple methods and properties to position the overall Access window - when the application is opened - in one of two positions - 1) Centered on the primary monitor or 2) Positioned exactly where the application was at the time of closing the last session. The size of the Access application is controllable as well. It is implemented as a class module, and has an additional required module. In the startup form or a global module, the AppPlace class is declared, and it takes about five more lines of code in the startup form, and it's done.

Caution: It makes extensive use of the Windows 32-bit API. It has not been converted to run in 64-bit Access. In my best guess, though the conversion would be trivial.

Another feature has a very complete informational panel that tells you about the size of your application, user forms, the overall screen size and the size and position of the primary monitor.
Attached File  AppPlace.JPG ( 83.47K )Number of downloads: 57

The zip file has two identical versions - AppPlace2003.mdb and AppPlace2010.accdb. It has one form for demo purposes. Looking at the form in the code window you'll see the minimum required calls to the class. In the class module, all the properties and methods are listed as comments, along with some narrative, mostly about how the four Access parameters are saved.

One caution - the last position of the Access window must be saved ay application close, so your application should be exited through a form so that the Form_Close event is fired. If you have multiple exits that one line of code can be put in all of the forms as long as you have declared the class globally. I have not tested it in Access 2007 or Access 2013, but my expectations are that it will work perfectly without modification.

These modules are pretty old, originating over fifteen years ago probably in Visual Basic 5; it has some code that while it works perfectly, isn't what I would do today. For instance there's a FindLast routine that is easily replaced by the built-in function InstrRev, introduced in VB6. But it's been working continuously in my applications since.
Attached File  AppPlace.zip ( 130.18K )Number of downloads: 138
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 11:27 PM