i did it a different way in the end so couldn't tell you i'm afraid.i ended feeding in a variable to determine the TOP 1-5, 6-10, 11-15 up using the CreateQueryDef to physically create the query and then constructed another query using the newly created one and this worked fine. Not the fastest i'm sure but not a production level query so not a big problem........ For L = 1 To 5 'the SUPER TYPEs intCol = 1 'reset the column count for the next row For j = 5 To 20 Step 5 'the TOP columns 1-5, 6-10, 11-15, 16-20 intCol = intCol + 1 'next column reference SQL_STR = "SELECT TOP 5 Type, Volume FROM VotingUniverse_TopFirmsVolumeByType " SQL_STR = SQL_STR & "WHERE Volume in (SELECT TOP " & j & " VotingUniverse_TopFirmsVolumeByType.Volume " 'feed in a variable SQL_STR = SQL_STR & "FROM VotingUniverse_TopFirmsVolumeByType ORDER BY Volume DESC) " SQL_STR = SQL_STR & "ORDER BY Volume ASC;" Set SubRank_Q = dbs.CreateQueryDef("VotingUniverse_Select_Top", SQL_STR) 'create this query to use in another ''''open a query to obtain the Volumes and %ages........using the created query above......returns 1 row SQL_STR = "SELECT VotingUniverse_TopTotalVolume.Type, VotingUniverse_TopTotalVolume.Volume, " SQL_STR = SQL_STR & "VotingUniverse_TopTotalVolume.TotalVolume, [Volume]/[TotalVolume] AS Perc " SQL_STR = SQL_STR & "FROM VotingUniverse_TopTotalVolume;" Set qdfTop = dbs.CreateQueryDef("", SQL_STR) qdfTop("Print_Order") = L 'filter to a specific super type Set rstTop = qdfTop.OpenRecordset(dbOpenSnapshot) ''''append to array InstType(L, intCol) = rstTop!Type Volume(L, intCol) = rstTop!Volume Score(L, intCol) = rstTop!perc DoCmd.DeleteObject acQuery, "VotingUniverse_Select_Top" 'remove to enable modification and recreation next loop rstTop.Close Set rstTop = Nothing Next j Next L
====Paul