Information générale
Catégorie:
Codage, syntaxe et commandes
>>>>>>>>I am using VFP3.0b for Windows.
>>>>>>>>
>>>>>>>>I have a combo box that returns a numeric value into a numeric field of a table. Not unexpectedly, the value that is stored into the field is the recno of the cursor not the bound value.
>>>>>>>>
>>>>>>>>Example: if 999 is the 15th value, then 15 is stored into the table.
>>>>>>>>
>>>>>>>>I have come across this is 2.6 and 3.0 before.
>>>>>>>>
>>>>>>>>How do I write the proper value into the field?
>>>>>>>
>>>>>>>Use unbound combo.
>>>>>>
>>>>>>Can't do that in VFP3.
>>>>>
>>>>>Nope, You can do it. Unbound combo means combo with empty ControlSource property.
>>>>
>>>>Sorry.
>>>>
>>>>When I try to change the controlsource to a variable or blank I get the following error:"Parent Object will not allow this property setting for
>>>> formset1.MRSASAVE.grdTest.cHotspot.Combo1.Controlsource"
>>>>
>>>>Any ideas what could be causing this?
>>>
>>>As long as Column has controlsource you cannot reset controlsource for its control. Actually, in a case of grid it would be more appropriate to use bound combo with Char field.
>>
>>Ahh... Got it. Thanks Ed.
>
>You know, I probably wasn't precise enough. Actually, you can create dummy column with empty controlsource or better add dummy field to grid.recordsource (view/cursor) and bind the column there, and add some code to combo.interactivechange event to populate real field with real value.
Great idea too. Thanks.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement