Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving info not in a dropdown combo box
Message
De
24/10/1999 17:23:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00280481
Message ID:
00280653
Vues:
13
>>>>>I have a combo box on a form that works great. However, I would like it to be able to 'save' info entered that is not in the list.
>>>>>I have tried different code , but cannot seem to get it correct.
>>>>>can anyone suggest a solution?
>>>>>TIA
>>>>>DAN
>>>>
>>>>*** Combo.Lostfocus event
>>>>If Not (This.Value==This.Displayvalue) && it indicates that the entry is not part of list
>>>>*** insert new record to the table behind the combo
>>>>Endif
>>>
>>>Thanks Ed....
>>>
>>>Would my code be
>>>
>>>If Not (This.Value==This.Displayvalue)
>>>Append blank
>>>Endif
>>>
>>>??
>>>
>>>Dan
>>
>>Nope. It will be like:
>>
>>If Not (This.Value==This.Displayvalue)
>> Insert Into mytable (myfield) values(this.displayvalue)
>>Endif
>>
>>You may also add Combo.Requery if you want added record to be seen in combo immediately.
>
>Thanks Ed, this code works good.
>However , even tho it does add the inputed data to the drop down list,
>it still doesnt keep the info in the field , unless one drops down and chooses it...
>Is there a way to also keep the added info in the field???

Do you mean a field- controlsource of this combo? If yes, then just add
Replace myfield1 with This.Displayvalue in mytable1
in the same place (right after Insert).
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform