Re: Forms, how to inform users of choices during data entry
Posted in 1991
Path: emory!ducvax.auburn.edu!darwin.sura.net!gatech!rutgers!ub!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!nucsrl!tellab5!odgate!mike From: mike@odgate.odesta.com (Mike J. Kelly) Newsgroups: comp.databases.informix Keywords: forms Message-ID: <1991Dec5.185748.21249@odgate.odesta.com> Date: 5 Dec 91 18:57:48 GMT References: <769@skyking.UUCP> <1991Dec4.165400.1152@news.larc.nasa.gov> Organization: Odesta Corporation RE: displaying choices. Original question was to have a "hot key" that displays list of possible values from a separate lookup table when in a field. When I was doing INFORMIX programming, I came across this so many times that we put together a generic code-lookup package. We always had a codes table which had three columns: TYPE, CODE and DESCRIPTION. The TYPE column would describe the code category (e.g. "STATE", "DEPT", etc.) The CODE and DESCRIPTION field were wide enough to contain the longest code and description. Then all you need is a routine, lookup_code, which takes as its arguments a code type and returns a code. It declares a cursor into the CODES table where TYPE = code_type and displays, in a display array, all the matching code/description pairs. The user scrolls through the list and presses ESCAPE when he or she has found the code they want. You then return that code. We had all the forms access this with an ON KEY that looked at the current field name to determine the value for TYPE. In required fields, we also had this routine called in an AFTER FIELD clause if the field value was left blank (so that lookup was automatic if the user left the field blank). -- -- Mike Kelly Odesta Corporation, Northbrook, Illinois, USA ...!clout!odgate!mike - Until odesta.com is registered. odgate!mike@clout.uucp - From the Internet.