* Here the basics of the SQL statement are created, including the join to the usertable lcSelect = "SELECT "+ lcTblMaster + ".id, desc, notshown FROM " +lcTblUser lcSelect = lcSelect + " LEFT OUTER JOIN " + lcTblUser + " ON " + lcTblMaster + ".id = " + lcTblUser + ".id AND " lcSelect = lcSelect + lcTblUser + ".user = '" + ALLTRIM(oApp.cUserName) + "'" lcSelect = lcSelect + " WHERE installed == .T. AND " * A case structure is used to decide which specifics are needed for the current view, in a general way DO CASE CASE This.cmbRomView.Value = "Default" && All 'shown' records lcSelect = lcSelect + " NOT notshown == .t. " CASE This.cmbRomView.Value = "Favorites" lcSelect = lcSelect + " favorite == .t. " CASE This.cmbRomView.Value = "Alles" lcSelect = lcSelect + " 0=0 " OTHERWISE lcSelect = lcSelect + " 0=0 " ENDCASE * Using a property on the form, specific filtering options can be set IF LEN(This.csqlwhere) > 0 lcSelect = lcSelect + " AND " + This.csqlwhere ENDIF * Set the displaying order based on the second combo lcSelect = lcSelect + ' order by ' * For future expansion, this has already been changed into a CASE. Right now it seems a bit overkill DO CASE CASE This.cmbSorteren.Value = 'desc' lcSelect = lcSelect + ' desc ' CASE This.cmbSorteren.Value = 'lastaccess' lcSelect = lcSelect + ' accessed desc ' OTHERWISE lcSelect = lcSelect + ' desc ' ENDCASE * Specify the destination of the result lcSelect = lcSelect + " Into Cursor crsViewTemp " * Take the command, and place it on the listbox ThisForm.lstView.RowSource = lcSelectChanging the join-statements doesn't work. I tried creating the same thing with the view-designer, but it somehow keeps messing up. Does anyone have an idea what's wrong with this?