Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox - Dropdown combo not saving text
Message
From
19/06/2002 07:53:45
 
 
To
18/06/2002 16:52:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00669906
Message ID:
00670066
Views:
20
Hello Larry.

I'm using a public array as the row source.

Tsk, tsk, tsk. It would be a lot better if you added an array property to your combo box class and used that as its RowSource. JMHO.

the data only gets saved if I select a value from the array. If I type in a value that isn't, it doesn't save. Am I using this control wrong, or are there additional setup paramaters I'm missing.

You have to take some action to add the value to the control's RowSource whent he user types in something that is not in the list. Code like this, in the combo's valid, will do it for you:
WITH This
  IF NOT EMPTY( .DisplayValue ) AND .ListIndex = 0
    lnLen = .ListCount + 1
    DIMENSION .aContents[ lnLen ]
    .aContents[ lnLen ] = .DisplayValue
    .Requery()
   ENDIF
ENDWITH
Previous
Reply
Map
View

Click here to load this message in the networking platform