Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convincing a combobox to requery itself
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Convincing a combobox to requery itself
Divers
Thread ID:
00244431
Message ID:
00244431
Vues:
45
I created a class based on a combobox to display a list of cities. The RowSourceType is 3-SQL. I build the SQL statement in the init and replace the RowSource.

Init ex:
local lSource
lSource = "SELECT * FROM city WHERE !DELETED() ORDER BY 1 INTO Cursor " + This.Name
This.RowSource = lSource 
This.Refresh
This works fine.

In the right click event I placed the following:
local lcNewCity
lcNewCity = proper(EditTextBox("", "Add new city"))
Insert into city (cityname) value (lcNewCity)
This.requery
This.refresh
This.value = lcNewCity
This.Displayvalue = lcNewCity
When I run the form the combo displays all the current records, however if I rightclick and add a city it doesn't show up? I browsed the actual cursor and it's not there. It does exist in the base table, and will show up in the combo the next time I run the form.

Any ideas?

TIA
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform