Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box with SQL
Message
 
À
02/02/1999 20:19:49
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00183232
Message ID:
00183260
Vues:
20
Carol,
When you requery an SQL statement it looks at the data on your harddisk, not the buffered data. That's why you don't see your added data until you do a TableUpdate(). Why don't you set your RowType to ALIAS and use a cursor instead of a direct SQL. If you use a read/write cursor you can add records 'on the fly'. A combo requery will look to the cursor, and will not re-run the SQL.

PS: Coming to DevCon this year?

HTH
Barbara

>VFP5.0a (still waiting for our 6.0 order to arrive)
>
>I have an employee table that contains the usual information such as name, ssn, company, etc.
>
>When the user adds a new employee, I need a combo box that will list the existing companies with incremental search capabilities, and at the same time allow entry of a new company.
>
>I found code in the 1996 DEVCON session by Tamar, "combo boxes, the forgotten controls". It gave me 99.9% of what I wanted, but I'm still missing something.
>
>I use a SQL statement to populate the row source:
>
>"Select distinct company from employee"
>
>Row type of course, is SQL statement.
>
>When I click on the form's Add button to add a record, I am able to type in the new company into the combobox, but it "disappears" when I do a requery(). If I type in the new company and force a tableupdate, then the requery works fine, but the Revert button has lost all meaning.
>
>I'm sure someone has already figured this out.
>
>Thanks in advance
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform