by James Bott » Wed Oct 04, 2006 11:49 pm
Tim,
You can do this with a DBCombo. If the data is already in a DBF and you don't really need to display the value, then just display the description and DBCombo returns the value.
REDEFINE DBCOMBO oCbx VAR cDeptCode ID 101 OF oDlg ;
ALIAS 'DEPT' ;
ITEMFIELD 'DEPTCODE' ;
LISTFIELD 'DEPTNAME'
Otherwise, if you really must display the value, then create two arrays, one containing both the value and the description concantenated, and another containing just the value. Use the concantenated array as the description (aList) array and the value array as the other (aItem). The value will then be returned.
oCbx:setItems( aItem, aList )
I find that most users don't care a bit about the value (custno, etc.). It is the computer that needs that, so I usually just display the value.
James