[AccessD] Your favorite control behavior

Jürgen Welz jwelz at hotmail.com
Wed Mar 10 00:33:33 CST 2004


Getting back to my favorite control behavior:

I like list boxes to have a clickable heading that toggles sort direction 
over each column in the list.  For multi select list boxes, I like to have 
label buttons at the bottom for selecting All, None or Inverting the 
selection.

I build these as subforms receiving property settings from the parent form 
as to the number of columns, the column widths and the rowsource.  These 
subform lists resize themselves to the size of the subform allotted them on 
the parent form.  The clickable sort/select buttons are always labels that 
appear depressed on mouse down and raised on mouse up.  I also move a small 
graphic arrow indicating the sort direction and which column is currently 
sorted on top of the label clicked on.  Using a label to receive the click 
prevents focus from moving from the list or the parent form.  I change the 
itemdata property of the graphic to indicate the sort direction.  The 
concept looks a lot like the sorting in Outlook and some versions of windows 
explorer and the users immediately grasp the significance.  As I don't like 
to requery to fill these lists by direction, I always like to use arrays as 
a rowsource and only requery when the list data has changed.  (It has always 
been my contention that I'd rather run a line of code than retrieve a bit 
over a LAN as the code executes faster than bits can travel).  I have been 
using disconnected data wherever possible, even in Access 97, and sorting 
arrays rather than retrieving recordsets sorted one way and then another and 
this approach has nearly always been applied to my sortable lists.



Ciao
Jürgen Welz
Edmonton, Alberta
jwelz at hotmail.com

_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*   
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines




More information about the AccessD mailing list