Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I use combo box to accept entry from user?
Message
De
22/08/2004 11:35:02
 
 
À
18/08/2004 21:05:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00934336
Message ID:
00935315
Vues:
23
Hi Evelyn.

i have a combo where recordsource is (select * from comments). user has to select from the records in table comments.

The sumplest approach is going to be to change the RowSourceType of your combo to either 2-Alias or 6-Fields. Then, you add a little bit of code like this in the Valid() of the combo:
lcDisplayValue = ALLTRIM( This.DisplayValue )
IF NOT EMPTY( lcDisplayValue ) AND This.ListIndex = 0
  *** The user has typed something that is not in the combo's list
  *** add it to the underlying data now
  INSERT INTO Comments ( < Field Name > ) VALUES ( lcDisplayValue )
  TABLEUPDATE( 0, .F., [Comments] )
  This.Requery()
ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform