I keep on getting a timeout error. As soon as the code goes into selectcontrol it takes too long to process can anyone tell me what is wrong with the code, in particular the sql statement there are only 10 rows in the table:<BR><BR><BR>For intLoop=0 to colorarray.Count - 1 <BR> selectcontrol "color", coloritems(intLoop) <BR>Next <BR><BR>Sub selectcontrol(colid, subcat_id)<BR>sqlstatement = "select DISTINCT " & colid & " from products where subcategoryid='" & subcat_id & "'"<BR>set idfromproducts = objConnection.Execute(sqlstatement)<BR>idfromproducts.MoveFirst<BR>count = 0<BR>do while not idfromproducts.EOF<BR> count = count + 1<BR> idproducts.add count, idfromproducts(colid)<BR>loop<BR> idfromproducts.close<BR> set idfromproducts = nothing<BR>end Sub