I'm not particularly familiar with Access, but surely you can just do<BR><BR>select top x * from table<BR><BR>?<BR><BR>using rowcount in SQL server will trim the recordset after having pulled the whole recordset out, so really you should use top in SQL Server as well.
I ofcourse can do <BR>Select Top 10 * FROM table<BR>Select Top 25 * FROM table<BR>Select Top 50 * FROM table<BR>...<BR><BR>But I want to switch that number with a parameter.<BR><BR>If I do something like<BR><BR>Select Top [parameter] * FROM Table<BR><BR> I get an error.<BR><BR><BR>
Use dynamic sql:<BR><BR>@sql='Select top +' @numberofrows +' * from table'<BR><BR>exec(@sql)<BR><BR>You will get a performance loss, but it would it would be a boost over your rowcount idea.
That only works in SQL server.<BR><BR>You can not use a parameter in the top clause, so you must either prepare a bunch of queries or create a select statement at runtime. From what I've heard about queries in Access I would recommend the latter.