Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box Headache
Message
De
04/07/2003 07:44:55
 
 
À
03/07/2003 16:18:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00806722
Message ID:
00806915
Vues:
17
Hi Tim.

I've been struggling with this all day. I've got a combo box that holds a list of freight carriers. If a freight carrier is listed, that's fine, they can select it. However, if the carrier is not in the list, they are allowed to type the name in. I have a ControlSource set to an object's property, cCarrier. The RowSource is set to another property, aCarrier (an array, 'natch). RowSourceType is 5-Array.

You have to take action to add the new value to the combo's RowSource and then requery the combo. So, in the case of your array, you need code like this in the combo's valid():
IF NOT EMPTY( This.DisplayValue ) AND This.ListIndex = 0
  *** New item typed in, add it to the array
  lnLen = This.ListCount + 1
  DIMENSION This.aCarrier[ lnLen ]
  This.aCarrier[ lnLen ] = This.DisplayValue
  This.Requery()
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform