Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dropdown List Box and SQL Cursor Table
Message
From
29/06/1997 17:27:38
Linda Morgan
Garden City Community College
Garden City, Kansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00037955
Message ID:
00038060
Views:
39
>>Using VFP 5.0
>>I have a dropdown list box which is populated with an SQL statement sent to a cursor table. This drop down box value is not tied to any source. table. It's function is to locate record information and populate several other txtboxes on the form. Is there any way to "refresh" the cursor table for subsequent adding records or editing records.
>
>Probably you can use a view instead of cursor and issue =REQUERY()to refresh it (and REQUERY() method for the listbox).
>
>> When I run the form, add a new record (using the dropdown list to interactively copy data to several txtboxes) everything works fine. If I add or edit a subsequent record, the dropdown list (populated by the cursor table) points to the same record that I used before. The incremental search doesn't work. The only way I can use the same record is to down arrow in the combobox and then uparrow at which point it will now accept the same record. Not what I want to do.
>>
>>Thanks in advance
>>
>>Linda
>
>Probably you can use a view instead of cursor and issue =REQUERY()to refresh it (and REQUERY() method for the listbox).
>
>About second part, I didn't completely understand in which area you are adding or edit records and how it refers to that listbox RowSource cursor.
>Could you provide more details?
>
>Nick

In response to the second part - - maybe the first part too! The SQL statement populates the dropdown combo fine. During the same session, the following happens.
1. User updates a record via the form and uses the dropdown combo to select a name (Smith, John). User saves this record. The first time in a new session, the combo dropdown is at the beginning of the name list (alphabetical by last name)

2. User moves to the next (or any other record), when the user uses the same dropdown box, the SQL record pointer is pointing at the SAME (Smith, John) name as was used to update the previous record. The normal method of selecting Smith, John doesn't work. User has to move to another name - then move back up to Smith, John before they can select Smith.

This isn't a critical point - but irritating. Surely there's a way to tell the SQL to GO TOP or something - - I just haven't found the right place to put it.
Thanks for your earlier response.

Linda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform