Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convincing a combobox to requery itself
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Convincing a combobox to requery itself
Miscellaneous
Thread ID:
00244431
Message ID:
00244431
Views:
44
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!
Next
Reply
Map
View

Click here to load this message in the networking platform