Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the deal with Combos?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00273965
Message ID:
00274603
Vues:
35
>>>>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's enough to set Combo.Displayvalue=mytable.myfield in some place. The dumb one is form.refresh method.
>>
>>
>>Set the DisplayValue property after adding the new value to your array. You may also want to remember to write the array back to the table if you want newly added values to persist over sessions.
>>
>>Mike A
>
>I don't use arrays here, if you meant me :-).

I was referring to the top of the message that said the RST was an array. It sounded like an array was built for the RST, but the entered value was not in the array. To get the value to 'stick' you have to put the new value in the array and the reset the DisplayValue. Whether you write the 'new' value back to whatever was used to create the array for the RS is up to you. If you don't add the new value to the original source for the array, then the next time the user adds a record that needs that value or uses that value, the value will not stick again.

Mike
Michael P. Antonovich, MCSD
Email: mike@micmin.com
MicMin Associates - Orlando, FL


Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform