Centering a form in the Access window

2397 Downloads

Author:  Peter Schroeder

This  example (A2K format) contains a module that can be used to reliably center (both horizontally and vertically) a form in the Access Window. There is a very simple demo of how it works, as well. The module itself uses Windows API calls to determine the Access application client area and the dimensions of the form in question, and calculates what the TOP and LEFT settings of the form should be to be centered in the Access window.

 

To use, simply insert the entire modCenterForm into your own database. It is called as follows:


Code:


 

Call gfncCenterForm([form])

Category: Example Forms
File Size: 15.21 KB
File Type: application/zip
Hits: 75694 Hits
Download: 2397 times
Created Date: 03-12-2016
Last Updated Date: 03-12-2016

Related documents

Wizard Form template
Wizard Form template

** Updated 1/9/2010 to handle an issue with Access 2010.

 

Picture in Database
Picture in Database

By Candace Tripp (utter:angel) Access 2000 format

 

Demonstrates a method of displaying a picture/image file in a database/formwithout storing the image in a table.

Pop ups - Calendar, Calculator, Zoom box
Pop ups - Calendar, Calculator, Zoom box

Authior: Unknown

I have been using this code since 1993 with Access 2.0. The download file includes the Access 2.0 version,. I have also included the upgraded versions for Access 97, Access 2000, and Access 2007. 

 

It has a Zoom Box, Calendar and Calculator created with just native Access controls. The pop up forms can be used to edit the data in as many  text box controls as needed. The controls can be on the same form or multiple forms.


Fancy Sort in Continuous Forms
Fancy Sort in Continuous Forms

Here's an interesting method of sorting columns in a continuous form. In this case, a subform is used, but the same can be applied to a main form. All the code is behind the form, so there is no need for a regular module.

In the attached Access 97 demo, all this code is in the "sfrmVST" form (a subform).

The first thing to do is to set up each column's title label with a consistant naming convention; "lblxxxxx". Then, each label has a "Tag" property value that contains the name of the 'field' it represents.

There is also another label that is set far to the left of the form. This particular label is special in a couple of ways. First, it's font is set to Marlett and it's visible property is set to "No". The caption of this label is the number "5". It is also important that the label be named: "lblSortIndicator". The "OnClick" event of this label should contain the following code:


Me.lblSortIndicator.Visible = False
Me.OrderBy = ""

25 Cool Control Tricks
25 Cool Control Tricks

Author: database Creations

 

 

Document Links
Document Links

This is a basic example of how to store the path to  a file and also be able to view the file. You can browse using the standards windows common dialog to select the file. You can view the file using the application defined with the Windows File Associations. It uses the ShelExec API to open the file. It does not use the .Followhyperlink  method.

This example is a continuous form that could easily be used as a sub form to attach multiple documents to a record.