Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box Headache
Message
From
04/07/2003 07:44:55
 
 
To
03/07/2003 16:18:57
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00806722
Message ID:
00806915
Views:
20
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform