Permitting the user to enter an item that isn't in the list defeats the purpose of using a combo box in the first place. Having said that, I realize there may be occasions where this sort of functionality is required. For example, let's suppose a particular field in a table is usually populated from a set of standard selections. However, occasionally none of the standard selections are suitable and the end user needs to enter something that is not in the list. Clearly, if the non-standard items were regularly added to the underlying lookup table, the table would grow quickly with seldom used entries. In this instance, the field binding to the combo box must contain the description of the item in the lookup table and not its key value. Obviously, if we allow the field to be bound to items that are not in the list, we must store the information in this non-normalized manner. The only place to "look up" such ad hoc items is in the bound field itself!
The easiest way to implement what you are trying to do is to create a custom combo class and add a custome cControlSource property. This code in the combo's Init():
IF DODEFAULT()
WITH This
.cControlSource = .ControlSource
.ControlSource = ''
ENDWITH
ENDIF
Add a custom method called RefreshDisplayValue() and called this method from the combo's Refresh and GotFocus methods to update its DisplayValue with the value of the field to which it is bound. This code in RefreshDisplayValue() :
LOCAL lcControlSource
WITH This
IF ! EMPTY( .cControlSource )
lcControlSource = .cControlSource
.DisplayValue = &lcControlSource
ENDIF
ENDWITH
Finally, add a custom method called UpdateControlSource() and call it from the combo's Valid to (you guessed it) update its control source from its DisplayValue:
LOCAL lcAlias, lcControlSource
WITH This
IF ! EMPTY( .cControlSource )
lcAlias = JUSTSTEM( .cControlSource )
IF UPPER( ALLTRIM( lcAlias ) ) = 'THISFORM'
lcControlSource = .cControlSource
STORE .DisplayValue TO &lcControlSource
ELSE
REPLACE ( .cControlSource ) WITH .DisplayValue IN ( lcAlias )
ENDIF
ENDIF
ENDWITH