PARAM xTable_Name,xField_Name,xSelected_Value && xTableName,xField_Name helps to create cursor DODEFAULT() MAIN_TOOLBAR.ENABLED = .F. CreateSqlCursor(xTable_Name,xField_Name,"Select_List") ThisForm.Xlist1.ROWSOURCE = "Select_List." + xField_Name xSelected_Value = ALLTRIM(xSelected_Value) IF !EMPTY(xSelected_Value) FOR lnFor = 1 TO ThisForm.Xlist1.ListCount thisform.Xlist1.LIST(lnFor).SELECTED = (thisform.xList1.List(lnFor) $ xSelected_Value) && ERROR AT THIS POINT NEXT ENDIF