Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding records to a table via combobox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00097388
Message ID:
00097412
Vues:
23
I think that's what I did (here is my exact code):

If This.DisplayValue <> This.Value
Insert into Cfaddres (ad_city) ;
Values (This.DisplayValue)
Endif

but several odd things happen. 1) If after typing my new city, then before saving it I click on the combo box whatever I had entered is wiped out (autoerase feature:). Assuming I don't do that, but type in a city "Test", then hit my save button, I first get the message that my changes were saved successfully, and I see "Test" sitting there in the combobox. But then if I go to a previous record and come back to the one supposedly just 'saved' the combobox is blank again. If I try to go to a previous record again (leaving the combobox control blank), this time I get a trigger failure on update. The only thing which works is for me to select one of the displayed items in the combobox.

Sylvia

(I used an Insert into table instead of append blank)
>
If you put this in the lostfocus event it should work...
>
>if this.value != this.displayvalue
>
> append blank in yourtablename
> replace fieldname with this.displayvalue in yourtablename
>
>endif
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform