Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the deal with Combos?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00273965
Message ID:
00273970
Views:
23
Mark,

I've been down that road. There doesn't seem to be anything automatic about ComboBoxes. If you have an array called "aList" in your form, try this code in the ComboBox's Init event:


IF THIS.ListIndex = 0
piRows = ALEN(THISFORM.aList) + 1
DIME THISFORM.aList[piRows]
THISFORM.aList[piRows] = THIS.Text
THIS.RowSource = THIS.RowSource
THIS.ListIndex = piRows
ENDIF



>Until now I have always used combos as dropdown lists. Now I am trying to use one as a dropdown combo. I have tried RowSourceType as SQL but abandoned that since I can not update the cursor with a new item. Now the RST is an array stored as a parent form property. The array is created successfully by selecting StaffName from my staff table. I then scan the array to see if the current value of the ControlSource is a member of the array. If not I call the AddItem method to dimension the array to add 1 row. I populate the new row with the passed value.
>
>The problem is, if the current data was not in the list, the combobox value is blanked instead of setting its value to the data value from the ControlSource. What are the tricks to keeping and saving data values that are not part of the combo's list?
>
>TIA!
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Reply
Map
View

Click here to load this message in the networking platform