Fancy Sort in Continuous Forms

1794 Downloads

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 = ""

Category: Example Forms
File Size: 44.05 KB
File Type: application/zip
Hits: 13167 Hits
Download: 1794 times
Created Date: 03-12-2016
Last Updated Date: 03-12-2016

Related documents

DB Manager
DB Manager

Author: weAscend Technologies

 

Link to any MDB or MDE file and view/edit data in tables with an added search feature. (Access 97).

 

This show how to have a dynamic grid that adjust to the number of fields in the query

 

It can be updated to Newer vrsions.

 

Dynamic Shortcut Menus
Dynamic Shortcut Menus

This is a demo of how to create shortcut menu bars from table data.

Unlike the shortcuts on normal shortcut menu bars all the shortcuts in the demo are driven by VBA. This allows altering the normal behaviour of the shortcut or creating your own.

In this demo the shortcut menu bar is generated in the On Current even of a continious sub-form. The shortcut menu bar could also be generated in the On Open event but the On Current event would allow modifing the shortcuts on the fly depending on current data in the record.

The shortcut data in the table can be flagged as required or not on a Form by Form basis.

Some of the examples given are: -
Spell check.
Sort ascending.
Sort descending.
Filter by selection.
Remove filter.
Call a public function with control data.
Call a public function with the primary key.
Export the current Sort/Filter selection to Excel, Word, etc.
Call public functions.
Execute hyperlinks.

Basically what this means is that if we can write code to do something then that code can be called from a shortcut.

The attached demo, in Access 2003, has been tested with many regional settings and requires no references.

ComboBox trick like on web pages
ComboBox trick like on web pages

Here is an example of how to make a combo box display text like "Find a Customer" and then when you click the drop down arrow, the text goes away. This is similar to what you see on web pages.

The attached is in 2000 format.  

 

Centering a form in the Access window
Centering a form in the Access window

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

Wipe/Move/Resize Effects for Forms
Wipe/Move/Resize Effects for Forms

By Candace Tripp (utter:angel) Access 2000 format

 

This demo shows how to create nice "wipe" effects on a form event (such as form_close) using the Win APIs MoveWindow and GetWindowRect. Effects include: resizing, wipe up/down left/right, shrink/move, and shiver.

Wizard Form template
Wizard Form template

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