Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convincing a combobox to requery itself
Message
From
21/07/1999 18:01:23
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00244431
Message ID:
00244433
Views:
20
>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

I guess you work with buffered table. Select-SQL retrieves records from the base table, skipping all buffered changes until you Tableupdate().
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform