There have been several threads over the years regarding cifcombobox. I have spent a lot of time developing a series of classes to handle lookup tables generically. I have over 60 lookup tables and after a lot of work realised that all lookups had a commonality about them. The basic principle was to have a combos table with 5 fields: cid, luname, active, list_type, ref_field plus I use createuser, createdate etc in all my tables but they are not relevant to this discussion.
LUName (lookupname) and active are obvious.
So all lookup names are LUName and only Active ones are displayed.
Where more detail is required, I use a separate table - provider is an example which contains names, addresses, etc... This table is linked to the combo table using the cid of the Provider table stored in the Ref_field field of combos. Thus all lookups use combos as the primary display and the other linked table is only used for editing etc or adding new data. Mostly I only want to store the cid of the lookup table.
Therefore by using a common luname, cid I have built classes for the entire functionality; acifcombobox - subclass of iifcombobox frmsystem - a listbox with the primary groupings - colour, breed etc... and the 2 character combocode whic calls frmlookup. frmlookup - a form containing a list of all entries for a particular code - e.g. colour, provider etc.. frmcomboedit - to edit or add new entries for those records only requiring the base information - cid, luname including new items from acifcombobox. other forms are subclassed from frmcomboedit using a container with the additional information.
The whole thing ties together into a complete lookup table maintenence system with minimal filling in of properties for different groups. In most cases all that is needed is to place the 2 character combocode - CO for colour, BR for breed and so on to get it all working.
Anyway, it almost complete and bug free. If there is interest I can write an article for the Wiki on the new app development manual. Is this the sort of thing needed for this project? Can I post screen shots on the Wiki or is a Word article posted through the download page better?
©2001 graeme thomson |