Hi Greg.
>I have a combobox on a form with the control source as table.field . The style is dropdown combobox. I also have items in its list. When I enter a value in the combobox instead of choosing one from the list it doesn't get saved to the table. If I choose a value from the list the item gets saved. Why doesn't the keyed-in item get saved?
Because you have to take some action to add the new value to the combo's RowSource like in the following example. Note, this example assumes a bound column of 2, boundTo = true, RowSourceType = Alias and RowSourceType = ClntType.
This code goes in the combo's valid:
LOCAL lnRetVal
IF This.Value > 0
* Do Nothing
ELSE
IF !EMPTY(This.DisplayValue)
SELECT ClntType
*** Get new PK for the Client type
lnRetVal = GetKey('CLNTTYPE', 'CL_TYPE')
IF (lnRetVal > 0) AND (lnRetVal <= 2147483646)
SELECT ClntType
INSERT INTO ClntType (Cl_Type, TypeDesc) VALUES (lnRetVal, This.DisplayValue)
=TABLEUPDATE()
THIS.Requery()
THIS.Value = lnRetVal
ENDIF
ENDIF
ENDIF
<\pre>
Marcia