>I use a cbo in my form and for some situation I need to disable a line in the list of selection for the cbo.
>
>The cbo use a control source "Alias" and the item display in the list are from a field Descip.
>
>I ma new at this, any one can help me?
You cannot disable the items with rowsourcetype = 2 (Alias), but for example you could use rowsourcetype = 5 (Array) ( if it is convenient, of course).
Say, you can do SQL select from your table to array like this:
SELECT Descip FROM myTable into array myArray
myArray will be the RowSource for the combo.
Then when you need to disable the combo item which corresponds to the field value in myTable, you find the corresponding array element, add backslash in front of the element, say:
myarray[5] = "\" + myarray[5]
thisform.myCombo.Requery()
and the item is disabled.
HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison